| 7 | const globalConfigPath = path.join(__dirname, 'globalConfigMongo.json') |
| 8 | |
| 9 | class MongoEnvironment extends NodeEnvironment { |
| 10 | constructor (config) { |
| 11 | super(config) |
| 12 | } |
| 13 | |
| 14 | async setup () { |
| 15 | const globalConfig = JSON.parse(fs.readFileSync(globalConfigPath, 'utf-8')) |
| 16 | |
| 17 | this.global.__MONGO_URI__ = globalConfig.mongoUri |
| 18 | this.global.__MONGO_DB_NAME__ = globalConfig.mongoDBName |
| 19 | |
| 20 | await super.setup() |
| 21 | } |
| 22 | |
| 23 | async teardown () { |
| 24 | await super.teardown() |
| 25 | } |
| 26 | |
| 27 | runScript (script) { |
| 28 | return super.runScript(script) |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | module.exports = MongoEnvironment |
nothing calls this directly
no outgoing calls
no test coverage detected