diff --git a/packages/jest-runtime/src/index.ts b/packages/jest-runtime/src/index.ts index 86e7115f9860..81e676968009 100644 --- a/packages/jest-runtime/src/index.ts +++ b/packages/jest-runtime/src/index.ts @@ -464,7 +464,11 @@ class Runtime { options: InternalModuleOptions | undefined, moduleRegistry: ModuleRegistry, ) { - if (path.extname(modulePath) === '.json') { + if ( + path.extname(modulePath) === '.json' && + options && + options.isInternalModule + ) { localModule.exports = this._environment.global.JSON.parse( stripBOM(fs.readFileSync(modulePath, 'utf8')), );