diff --git a/src/environment.ts b/src/environment.ts index 961f20ba..5271f4d2 100644 --- a/src/environment.ts +++ b/src/environment.ts @@ -21,7 +21,7 @@ module.exports = class MongoEnvironment extends TestEnvironment { globalConfigPath: string; constructor(config: JestEnvironmentConfig, context: EnvironmentContext) { super(config, context); - this.globalConfigPath = pathJoin(config.projectConfig.rootDir, 'globalConfig.json'); + this.globalConfigPath = pathJoin(config.globalConfig.rootDir, 'globalConfig.json'); } async setup() { diff --git a/src/setup.ts b/src/setup.ts index 46822d75..95928bf8 100644 --- a/src/setup.ts +++ b/src/setup.ts @@ -21,7 +21,7 @@ const mongo: Mongo = isReplSet ? new MongoMemoryReplSet(mongoMemoryServerOptions) : new MongoMemoryServer(mongoMemoryServerOptions); -module.exports = async (config: JestEnvironmentConfig['projectConfig']) => { +module.exports = async (config: JestEnvironmentConfig['globalConfig']) => { const globalConfigPath = join(config.rootDir, 'globalConfig.json'); const options = getMongodbMemoryOptions(); diff --git a/src/teardown.ts b/src/teardown.ts index a7ca4c57..8dab3538 100644 --- a/src/teardown.ts +++ b/src/teardown.ts @@ -4,7 +4,7 @@ import type {JestEnvironmentConfig} from '@jest/environment'; const debug = require('debug')('jest-mongodb:teardown'); -module.exports = async function (config: JestEnvironmentConfig['projectConfig']) { +module.exports = async function (config: JestEnvironmentConfig['globalConfig']) { const globalConfigPath = join(config.rootDir, 'globalConfig.json'); debug('Teardown mongod');