Version
29.2.3
Steps to reproduce
- clone https://github.com/repobuddy/repobuddy/tree/ts-jest-29.2-issue
- pnpm i
- pnpm build
- pnpm jest test
Expected behavior
test pass
Actual behavior
/home/runner/work/repobuddy/repobuddy/packages/jest/ts/tests/chalk.spec.ts:1
({"Object.<anonymous>":function(module,exports,require,__dirname,__filename,jest){import { it } from '@jest/globals';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Runtime.createScriptFromCode (../../node_modules/.pnpm/jest-runtime@29.7.0/node_modules/jest-runtime/build/index.js:1505:14)
Debug log
see above
Additional context
It is working with ts-jest 29.1
the transform config is:
transform: {
'^.+\\.(ts|tsx|cts|mts)$': ['ts-jest', [{
isolatedModules: true,
useESM: true,
}]],
'\\.m?jsx?$': 'jest-esm-transformer-2'
},
transformIgnorePatterns: [],
I have also tried to use transformIgnorePatterns but also not working.
Environment
System:
OS: macOS 14.5
CPU: (10) arm64 Apple M1 Pro
Binaries:
Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node
npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm
pnpm: 9.5.0 - ~/.nvm/versions/node/v20.12.2/bin/pnpm
bun: 0.1.6 - ~/.bun/bin/bun
npmPackages:
jest: ^29.7.0 => 29.7.0
Version
29.2.3
Steps to reproduce
Expected behavior
test pass
Actual behavior
Debug log
see above
Additional context
It is working with
ts-jest29.1the transform config is:
I have also tried to use
transformIgnorePatternsbut also not working.Environment
System: OS: macOS 14.5 CPU: (10) arm64 Apple M1 Pro Binaries: Node: 20.12.2 - ~/.nvm/versions/node/v20.12.2/bin/node npm: 10.5.0 - ~/.nvm/versions/node/v20.12.2/bin/npm pnpm: 9.5.0 - ~/.nvm/versions/node/v20.12.2/bin/pnpm bun: 0.1.6 - ~/.bun/bin/bun npmPackages: jest: ^29.7.0 => 29.7.0