Closed sizuhiko closed 1 year ago
I noticed this as well. It would be best to add as a dependency or peer dependency.
Same issue here.
Meanwhile, as @swc/helpers is a pure esm module, it requires jest to be configured as esm enabled.
I ran into this as well (because of the pure ESM bit). It's technically an @swc/core thing, but @swc-node/jest explicitly enables externalHelpers
for some reason:
To inline the helpers, you can pass the externalHelpers
option via the swc
configuration section:
module.exports = {
transform: {
'^.+\\.(t|j)sx?$': [
'@swc-node/jest',
{ swc: { jsc: { externalHelpers: false } } }
]
}
}
Unfortunately, passing any of the swc
options clobbers everything that @swc-node/jest configures automatically for us (including paths
aliases), which kind of defeats the purpose of it altogether. I'm planning on opening a pull request to merge the swc
options instead.
Bump @swc-node/jest from 1.5.5 to 1.5.6, has some errors.
I try
npm i -D @swc/helpers
, then re-runnpm t
is successfully.I think better include
@swc/helpers
to peerDependencies.