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

Test with template literal is not working

Open micaelmbagira opened this issue 3 years ago • 9 comments

If you have such a test

it(`should ${'foo'}`, () => {
});

it will be skipped

The issue has apparently been fixed in jest-editor-support but the fix hasn't landed here. I guess it's just a matter of updating the dependency to the latest version and releasing a new version, is that correct?

micaelmbagira avatar Jan 20 '21 13:01 micaelmbagira

hey @micaelmbagira i guess yes.

firsttris avatar Jan 29 '21 19:01 firsttris

you can easily verify for yourself

clone the repo update package npm install (vscode) Go to Menu "Run" => "Start Debugging" open your project with the new vscode instance just open

firsttris avatar Jan 29 '21 19:01 firsttris

@firsttris unfortunately, updating jest-editor-support didn't fix it 😢

micaelmbagira avatar Feb 01 '21 13:02 micaelmbagira

can you check if this is working with version 0.4.33

firsttris avatar Apr 09 '21 19:04 firsttris

@firsttris Still not, unfortunately.

micaelmbagira avatar Apr 11 '21 12:04 micaelmbagira

I can confirm it stil doesn't work. The test will skip as soon a dollar sign is in the description.

it('skip me $' , () => {});

In case. Tested with Windows

gilphil avatar Apr 12 '21 09:04 gilphil

With an ` in the test name the console expects additional input on Windows.

$ node "c:/redacted/node_modules/jest/bin/jest.js" "c:/redacted.spec.ts" -c "c:/redacted/jest.config.js" -t "Test `"
>

mhartkorn avatar May 18 '21 14:05 mhartkorn

I can confirm for the current version, for us the test is skipped if the test-title is contains something like this with those special quotes inside

it('should trigger `onChange` event when value changes', () => {...

The onChange in this case is considered as a bash-command (which doesn't exist) because it's used directly in the commandline.

mhombach avatar Mar 24 '22 12:03 mhombach

It also doesn't work if the test name is not a string literal (e.g. describe(MyClass.name, ...) instead of describe('MyClass', ...))

tlevesque-ueat avatar Mar 20 '23 18:03 tlevesque-ueat