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

Support vitest

Open holtwick opened this issue 3 years ago • 1 comments
trafficstars

Your great extension could support Vitest out of the box once https://github.com/vitest-dev/vitest/issues/838 is fixed. Maybe you'd like to add that to your features list? It is sufficient to set jestCommand option accordingly.

Thanks for the great extension, I use it every day :)

holtwick avatar Feb 23 '22 10:02 holtwick

I am also using "vitest" in some of my project and the "Jest Runner" thinks these are Jest tests and renders a "Run" button.

When clicking the "Run" button the tests fail (because those are Vitests):

node '/home/bennycode/dev/bennycode/typescript4free/node_modules/jest/bin/jest.js'/home/bennycode/dev/bennycode/typescript4free/src/utils/sorting.test.ts' -t 'sorting finishes sorting one directory before going to the next' node:internal/modules/cjs/loader:1080 throw err; Error: Cannot find module '/home/bennycode/dev/bennycode/typescript4free/node_modules/jest/bin/jest.js'

My test cases have the following import headers:

import {describe, expect, it} from 'vitest';

@firsttris is it possible to not render the "Run" button when imports from "vitest" are being found in the test file?

bennycode avatar Oct 19 '23 18:10 bennycode