Closed wuifdesign closed 1 year ago
Can you create a reproduction repository?
@g-plane repo here: https://github.com/wuifdesign/swc-plugin-react-remove-properties-bug
npm run test
works fine, but if you add swc-plugin-react-remove-properties
it failes with:
> swc-plugin-react-remove-properties-bug@1.0.0 test
> jest
RUNS src/app.spec.tsx
Process finished with exit code -1073741819 (0xC0000005)
If you add/remove the swc-plugin-react-remove-properties
in the .swcrc
you have to run jest --clearCache
otherwise the result will be cached.
This plugin should be ignored for tests anyway, as the data-testid should not be removed when running test, otherwise tests will fail.
Plugin shouldn't concern about the environment. That is, it doesn't care whether it's running in testing or not.
but there is no way to exclude a plugin via .swcrc
just for testing, but keep it included for build. or did i miss something?
so this plugin can't be used if you want to use tests in your project.
What about try using different config files?
how do you use different config files in swc? i never found something like this
I don't know, sorry.
i think there is currently no way to do something like that. So it is sadly to say: "if you want to use swc/jest you can't use this repo" :(
even if it shouldnt be used in tests anyway.
@swc/jest
has documented about using different config files: https://github.com/swc-project/jest#usage .
thx, i will try that. but i think this issue is closed as you will not implement automatic disabling for tests, but you may want to include this stuff for swc/jest
in the docs.
If i use
swc/jest
and i have this plugin configured.swcrc
to use this plugin the tests will fails with:Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)