Closed nirgilboa closed 2 years ago
It's fixed by vscode team, see https://github.com/microsoft/vscode/commit/6f0c1b068a84ddf1c06cac054873ac7a8b5ff3ba
It's fixed by vscode team, see microsoft/vscode@6f0c1b0
Thanks for this! 🙏🏻 will wait for a new vscode version
When running npm run compile
I get the following errors (trying to pack README.md and LICENSE files)
ERROR in ./node_modules/@babel/plugin-syntax-typescript/test/index.js 1:0-54
Module not found: Error: Can't resolve '@babel/helper-plugin-test-runner' in 'C:\projects\vscode-jest-runner\node_modules\@babel\plugin-syntax-typescript\test'
@ ./node_modules/@babel/ sync ^\.\/plugin\-syntax\-.*$ ./plugin-syntax-typescript/test/index.js ./plugin-syntax-typescript/test/index ./plugin-syntax-typescript/test/ ./plugin-syntax-typescript/test
@ ./node_modules/babel-preset-current-node-syntax/src/index.js 39:17-64
@ ./node_modules/jest-snapshot/build/InlineSnapshots.js 203:19-70
@ ./node_modules/jest-snapshot/build/State.js 27:23-51
@ ./node_modules/jest-snapshot/build/index.js 9:36-54
@ ./node_modules/jest-editor-support/build/Snapshot.js 34:20-44
@ ./node_modules/jest-editor-support/build/index.js 130:39-60
@ ./src/jestRunner.ts 13:30-60
@ ./src/extension.ts 14:21-44
Which seems to come from https://github.com/nicolo-ribaudo/babel-preset-current-node-syntax/blob/93b2088940fd53adb7c4774d406176885443082f/src/index.js#L37-L41
But it doesn't look like that module changed, so not sure why I'm getting this error now
I think this extension packs wayyy too much of jest-editor-support
when it only needs the parser
I made a new parser.ts
file that only imports the parser and the build is much faster, avoids all these other issues and resulting extension file is much smaller (1.22MiB vs 5.43MiB in development)
// parser.ts
import type { ParsedNode } from 'jest-editor-support';
import parse from 'jest-editor-support/build/parsers';
export { parse, ParsedNode };
then all imports to jest-editor-support
is replaced by ./parser
then all imports to
jest-editor-support
is replaced by./parser
Awesome !! 💪🏻 If you don't mind I think fixing the CI should be merged first (once a new vscode version is released) and then merge your PR
All good! I agree should fix CI first. I made the change because I wasn't able to test the update otherwise and I wanted to confirm it fixed a parsing issue related to recent typescript language features, which it does 😁
@firsttris Build is now green 🎉 as it runs with vscode 1.65.0 which contains the bugfix we needed (https://github.com/microsoft/vscode/releases/tag/1.65.0)
Changes included:
jest-editor-support
to fix Typescript compilation errorstest-compile
step to GitHub WorkflowCurrently still facing the following error when running the tests, seems to be caused by: https://github.com/facebook/jest/issues/12398