firsttris / vscode-jest-runner

Simple way to run or debug one or more tests from context menu, codelens or command plalette
https://marketplace.visualstudio.com/items?itemName=firsttris.vscode-jest-runner
MIT License
265 stars 124 forks source link

Breaks when ts file contains `using` keyword #351

Open mickmister opened 8 months ago

mickmister commented 8 months ago

Hi I'm using the using keyword in my test, but this makes it so the "run test" buttons go away. This was added in typescript 5.2 https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-2.html#using-declarations-and-explicit-resource-management

How might I help fix this?

firsttris commented 8 months ago

hey @mickmister

jest-editor-support uses babel-parser to parse the test code.

https://github.com/firsttris/vscode-jest-runner/blob/master/src/parser.ts#L2 https://github.com/firsttris/vscode-jest-runner/blob/master/src/JestRunnerCodeLensProvider.ts#L60

i could imagine that this feature is not supported by babel-parser yet.

mickmister commented 6 months ago

Hi @firsttris, thanks for your quick response. Do you have a suggestion in how I might verify this, or request that this be done? Possibly request this in their repository? https://github.com/babel/babel

firsttris commented 6 months ago

somewhere on the bable site there was a section with features and plugins i remember. i remember this because we migrated from typescript to babel-parser in jest-editor-support.