linux-china / vitest-jetbrains-plugin

Vitest JetBrains plugin
https://plugins.jetbrains.com/plugin/19220-vitest-runner
Apache License 2.0
52 stars 6 forks source link

Backticks used within `it()` throws an error while running single `it()` #23

Closed pgejgalis-codilime closed 2 years ago

pgejgalis-codilime commented 2 years ago

Hello! I see an error when I have backtics inside the it() section and I want to run just one test:

  it('should allow to use backticks `here`', () => {
    // test code
  });

As a workaround I need to run whole describe() section (where I'm not using backticks)

npm exec -- vitest run -t "should allow to use backticks `here" src/my-test.tsx
sh: -c: line 0: unexpected EOF while looking for matching ``'
sh: -c: line 1: syntax error: unexpected end of file

Process finished with exit code 2.
image
linux-china commented 2 years ago

Yes, it's a bug from npm https://github.com/npm/npm/issues/20644

npm exec -- vitest run -t "should allow to use backticks \`here\`" src/my-test.tsx

and it works well with yarn.

yarn exec -- vitest run -t "should allow to use backticks \`here\`" tests/first.test.ts