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
Hello! I stumbled upon a possible issue while trying to override default .swcrc config in Jest.
.swcrc
I followed the documentation and updated my jest.config.ts file:
jest.config.ts
// ... import { readFileSync } from "fs"; const swcConfig = JSON.parse( readFileSync(`${__dirname}/.swcrc`, "utf-8") ) as Record<string, unknown>; const config: Config = { // ... transform: { "^.+\\.(t|j)sx?$": [ "@swc/jest", { ...swcConfig, exclude: [], // Attempt to override exclude }, ], }
My goal is to override exclude array (for production build I ignore *.test.ts files).
exclude
*.test.ts
Unofrtuenatly, when trying to run test I got:
FAIL <path to file>.test.ts ● Test suite failed to run cannot process file because it's ignored by .swcrc
Is there anything I do wrong in that case? Packages versions I use:
@swc/[email protected] @swc/[email protected] @swc/[email protected] [email protected]
No response
{ "$schema": "https://swc.rs/schema.json", "jsc": { "target": "es2022", "baseUrl": "./", "paths": { "src/*": ["./src/*"] }, "parser": { "syntax": "typescript", "tsx": false }, "externalHelpers": true }, "module": { "type": "es6" }, "exclude": [".*\\.test\\.ts$", ".*\\.map$", ".*\\.d.ts", "test/"], "sourceMaps": false }
https://github.com/piotrkabacinski/swc_jest_config_issue
exclude array should be overwritten by custom config in jest.config.ts
0.2.37
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Hello! I stumbled upon a possible issue while trying to override default
.swcrc
config in Jest.I followed the documentation and updated my
jest.config.ts
file:My goal is to override
exclude
array (for production build I ignore*.test.ts
files).Unofrtuenatly, when trying to run test I got:
Is there anything I do wrong in that case? Packages versions I use:
Input code
No response
Config
Playground link (or link to the minimal reproduction)
https://github.com/piotrkabacinski/swc_jest_config_issue
SWC Info output
No response
Expected behavior
exclude
array should be overwritten by custom config injest.config.ts
Actual behavior
No response
Version
0.2.37
Additional context
No response
The text was updated successfully, but these errors were encountered: