-
Notifications
You must be signed in to change notification settings - Fork 460
New issue
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
[Bug]: isolatedModules is not a replacement of transpileOnly #3930
Comments
You are mistaking between 2 isolatedModules options, see improvement issue here #3750 |
Um, but the problem is the same. So it seems to me that the |
I have made this a repro: https://github.com/justland/just-web/tree/ts-jest-isolated-modules git clone justland/just-web
git checkout ts-jest-isolated-modules
pnpm i
pnpm events test Here is the /** @type {import('jest').Config} */
export default {
displayName: 'events',
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
roots: ['<rootDir>/ts'],
testMatch: ['**/?(*.)+(spec|test|integrate|accept|system|unit).[jt]s?(x)'],
transform: {
'^.+\\.m?[t]sx?$': ['ts-jest', {
isolatedModules: true,
useESM: true
}],
}
} You will see the test fails. |
Version
29.0.3
Steps to reproduce
Don't have a minimal repro, as this is about how the flag works.
You can see a test failure here:
https://github.com/justland/just-web/actions/runs/3668482089/jobs/6201650192
Basically in that code, I have this line:
If I add
isolatedModules
totsconfig.json
, I'll get this error fromtsc
:That means
isolatedModules
should not be used as a replacement oftranspileOnly
, which was removed a while back.Expected behavior
The test should run.
Actual behavior
Failed as above
Debug log
no log needed
Additional context
IMO we should re-introduce
transpileOnly
setting.Environment
The text was updated successfully, but these errors were encountered: