ts-jest 25.3 breaks VSCode debug run
See original GitHub issueIssue :
Having to revert to ts-jest 25.2.1 because I receive this error when running tests for a specific file, despite blowing away node_modules:
Could not find source file: '/Users/pete.burkindine/git/ccxp/ccxp-client/node_modules/@ngrx/store/bundles/store.umd.js'.
The file is there and a normal run of ng test
does not have the same issue.
Here is the command that was run (by VS code launch setup on a specific file):
cd /Users/pete.burkindine/git/ccxp/ccxp-client ; /Users/pete.burkindine/.nvm/versions/node/v12.13.1/bin/node --inspect-brk=3326 node_modules/.bin/jest libs/features/provider-compare/src/lib/components/provider-data/provider-data-row-header-set/provider-data-row-header-set.component.spec.ts --config /Users/pete.burkindine/git/ccxp/ccxp-client/.debug/jest.config.js --runInBand --runTestsByPath --detectOpenHandles
Here is the jest.config used by the debugger
module.exports = {
rootDir: '../',
globals: {
'ts-jest': {
stringifyContentPathRegex: '\\.html?$',
tsConfig: '<rootDir>/.debug/tsconfig.spec.json',
astTransformers: [
'jest-preset-angular/build/InlineFilesTransformer',
'jest-preset-angular/build/StripStylesTransformer'
]
}
},
testEnvironment: 'jest-environment-jsdom-sixteen',
preset: 'jest-preset-angular',
testURL: 'http://localhost/',
transform: {
'^.+\\.(ts|html)$': 'ts-jest'
},
setupFiles: ['<rootDir>/tools/testing/setup/mapbox.setup.ts'],
setupFilesAfterEnv: ['<rootDir>/.debug/test-setup.ts'],
silent: false,
transformIgnorePatterns: ['node_modules/(?!@ngrx)', '<rootDir>/dist/'],
moduleNameMapper: {
'^@ccxp-client/(.*)$': '<rootDir>/libs/$1/src/index.ts',
'^@ccxp-client-testing/(.*)$': '<rootDir>/libs/$1/src/testing.ts',
'^tools/(.*)$': '<rootDir>/tools/$1',
'\\.svg$': 'identity-obj-proxy'
}
};
Issue Analytics
- State:
- Created 3 years ago
- Comments:19
Top Results From Across the Web
Visual Studio Code won't properly step on TypeScript code
Set a breakpoint on line 23 of hey.ts (first instruction of barFunction() ), the debugger will stop there, but if you step in...
Read more >Debugging with TypeScript, Jest, ts-jest and Visual Studio Code
I've been working on a TypeScript project where I'm using jest . I'm super happy with TypeScript and Jest and with ts-jest ,...
Read more >Debugging Jest with while --coverage enabled results in ...
We use jest with TS (via ts-jest). When I try to debug code ... Navigate to the line 671 and put break point...
Read more >Vsc, Visual Studio Code - Extensions - infos
Makes it easy to create, manage, and debug containerized applications. FREE. Java Test Runner 5M Microsoft Run and debug JUnit or TestNG test ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same kind of error:
Could not find source file: 'path\to\project\node_modules\lodash\index.js'.
I didn’t have any issue with previous ts-jest version and your zip fixes the problem@ahnpnl also fixed for me in 25.3.1, thanks for the prompt fix! 😃