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

Running tests with function or variable inside the name are not found #357

Open NikFrancelj opened 6 months ago

NikFrancelj commented 6 months ago

Hey, we have an issue with running tests with pinned run/debug and would like to know if the following is even doable with this extension. If your describe or it contains a function or variable inside the name or in string literal it doesn't find the test.

e.g.,

describe(addTag(Tags.UNIT, 'Some name'), () => ... )

Clicking on Run/Debug tries matching by addTag\(Tags\.UNIT, 'Some name'\) which results in test not found.

Thanks.

firsttris commented 6 months ago

i dont think this willl work because addTags() first needs to be resolved by a compiler to get the string.

mtoy-googly-moogly commented 4 months ago

If instead of addTag you use ${} to add the tag, then jestrunner does coolness to make the click work ...

describe(`Test Name - ${justTag(Tags.UNIT)}`, () => ....