Skip to content

Commit

Permalink
Allow JSON transforms for jestjs#2578
Browse files Browse the repository at this point in the history
  • Loading branch information
MLoughry committed Apr 5, 2019
1 parent 19b6292 commit 3512f57
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/jest-runtime/src/index.ts
Expand Up @@ -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')),
);
Expand Down

0 comments on commit 3512f57

Please sign in to comment.