diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index 09f611c67332..3057dbe6586e 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -475,7 +475,7 @@ export default class ScriptTransformer { } }, { - exts: [path.extname(moduleName)], + exts: this._config.moduleFileExtensions.map(ext => `.${ext}`), ignoreNodeModules: false, matcher: filename => { if (transforming) {