We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The mocking doesn't work with built-in modules when there is / in the import. The tests works with ts-jest without issues.
https://stackblitz.com/edit/swc-jest-bug?file=src%2Findex.spec.ts
{ "$schema": "https://json.schemastore.org/swcrc", "sourceMaps": true, "jsc": { "parser": { "syntax": "typescript", "decorators": true, "dynamicImport": true }, "transform": { "legacyDecorator": true, "decoratorMetadata": true }, "baseUrl": "./" }, "minify": false }
Operating System: Platform: linux Arch: x64 Machine Type: undefined Version: Ubuntu 20.04.0 LTS Tue Apr 30 2024 11:53:11 GMT+0200 (Central European Summer Time) CPU: (4 cores) Models: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Binaries: Node: 18.18.0 npm: 10.2.3 Yarn: 1.22.19 pnpm: 8.15.6 Relevant Packages: @swc/core: 1.4.17 @swc/helpers: N/A @swc/types: N/A typescript: 5.4.5 SWC Config: output: N/A .swcrc path: N/A Next.js info: output: N/A
Use manual mocks and test should pass
The manual mock is ignored
1.4.17
It's was working on
"@swc/core": "^1.3.105", "@swc/jest": "^0.2.31",
and broken after
"@swc/core": "^1.4.17", "@swc/jest": "^0.2.36",
The text was updated successfully, but these errors were encountered:
'ts-jest' is wrong here.#7435
jest.mock of ESM fails / Cannot modify ES modules.
Sorry, something went wrong.
kdy1
No branches or pull requests
Describe the bug
The mocking doesn't work with built-in modules when there is / in the import. The tests works with ts-jest without issues.
Input code
https://stackblitz.com/edit/swc-jest-bug?file=src%2Findex.spec.ts
Config
Playground link (or link to the minimal reproduction)
https://stackblitz.com/edit/swc-jest-bug?file=src%2Findex.spec.ts
SWC Info output
Operating System:
Platform: linux
Arch: x64
Machine Type: undefined
Version: Ubuntu 20.04.0 LTS Tue Apr 30 2024 11:53:11 GMT+0200 (Central European Summer Time)
CPU: (4 cores)
Models: Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Expected behavior
Use manual mocks and test should pass
Actual behavior
The manual mock is ignored
Version
1.4.17
Additional context
It's was working on
and broken after
The text was updated successfully, but these errors were encountered: