diff --git a/packages/jest-transform/src/ScriptTransformer.ts b/packages/jest-transform/src/ScriptTransformer.ts index 1864319361c2..b1ab7a935f45 100644 --- a/packages/jest-transform/src/ScriptTransformer.ts +++ b/packages/jest-transform/src/ScriptTransformer.ts @@ -759,6 +759,7 @@ class ScriptTransformer { } }, { + // Exclude `mjs` extension when addHook because pirates don't support hijack es module exts: this._config.moduleFileExtensions .filter(ext => ext !== 'mjs') .map(ext => `.${ext}`),