proposal: @oxc/jest
package
#3886
Labels
A-transformer
Area - Transformer / Transpiler
C-enhancement
Category - New feature or request
C-investigation
Category - it represents an investigation. Further steps may change/add C-label(s)
The Jest testing framework supports transforming code via transform plugins, such as
babel-jest
,ts-jest
, and@swc/jest
. It would be a large quality-of-life improvement to use oxc to transform files instead of any of the above packages. The transformer is progressing quite well, and making it usable in Jest could help with the adoption of oxc in general.Unfortunately, Jest only ships with
experimental support for ESM
, so transpilation to CJS is a must-have for this to work properly. I took a crack at this about two weeks ago. Within about 2 hours I got about 80% of the way there, with this missing plugin being the only remaining major blocker.Goals
package.json
,tsconfig.json
,.babelrc
, etc to configure transpilation correctlyTasks
oxc_transform
as an NPM package, similar to@oxc/parser
@babel/plugin-transform-modules-commonjs
plugin@oxc/jest
NPM package@oxc/jest
to the website.Considerations
@swc/jest
in a separate git repo from their core package. Should we do the same thing?@swc/jest
that prevent widespread adoption:@swc/jest
unconditionally hoists package imports, which breaks module mocking. This behavior is undocumented, and attempts to fix it by setting the appropriate config property fail as the package always overrides this user-provided value..swcrc
does not appear to be respected; I've only ever gotten configuration to work by passing a config option explicitly.@swc/jest
does not export type definitions for its config, and the various settings are completely undocumentedThe text was updated successfully, but these errors were encountered: