swc-project / swc-project/swc-node
Debugger will not stop at break points when using swc-jest
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 95
- Avg merge
- 14d 11h
- Merged PRs (30d)
- 1
Description
I think that this is because source maps must be generated inline.
A fix for this was proposed in #632, which set's the source map as inline for jest if it is undefined however it is not undefined by default.
I'm configuring jest in package.json using the preset
"jest": {
"preset": "@swc-node/jest",
...
}
A workaround is to set it manually
"jest": {
"transform": {
"^.+\\.(t|j)sx?$": [
"@swc-node/jest",
{
"swc": {
"sourceMaps": "inline"
}
}
]
},
...
}
I notice that when reading tsconfig it is given a default value. This may be the problem.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by comparing the swc-jest preset configuration with the workaround in package.json, then inspect the defaults around lines 99–107 of packages/register/read-default-tsconfig.ts and the change proposed in issue #632. Reproduce the breakpoint failure with the shown Jest setup and verify that debugging stops at the original TypeScript source without requiring manual inline source-map configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100