vscode-jest-runner icon indicating copy to clipboard operation
vscode-jest-runner copied to clipboard

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

Open NikFrancelj opened this issue 11 months ago • 2 comments

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.

NikFrancelj avatar Mar 01 '24 08:03 NikFrancelj

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

firsttris avatar Mar 01 '24 14:03 firsttris

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)}`, () => ....

mtoy-googly-moogly avatar Apr 09 '24 18:04 mtoy-googly-moogly