React is not defined
Describe the bug
In a very simple test for a component I keep getting React is not defined
To Reproduce Run test in the UI for a component
Expected behavior Run test successfully. The plugin works ok with non react tests. The react tests run without any issue in the console.
Screenshots

Environment
- OS: macOS
- VSCode version: 1.70.2
- Vitest version: 0.22.1
- Vitest plugin version: 0.2.24
Probably related to #13, but with my example it'll work fine until monorepo is supported.
If you have a monorepo, the command should be started with the help of your package manager. Here is an example with npm:
"vitest.commandLine": "npm -w @monorepo/package-name test --"
Put this line in .vscode/settings.json and it should work. Can't give yarn/pnpm examples but it's the same for all.
Also the package's package.json should contain the script you are calling, in this case is test:
"scripts": {
"test": "vitest",
}
Probably related to #13, but with my example it'll work fine until monorepo is supported.
If you have a monorepo, the command should be started with the help of your package manager. Here is an example with
npm:"vitest.commandLine": "npm -w @monorepo/package-name test --"Put this line in
.vscode/settings.jsonand it should work. Can't giveyarn/pnpmexamples but it's the same for all.Also the package's
package.jsonshould contain the script you are calling, in this case istest:"scripts": { "test": "vitest", }
@Pustinyak Thanks for the solution, I changed it a little bit for yarn, and works fine in one monorepo
"vitest.commandLine": "yarn workspace @monorepo/package-a test --watch"
but I also have a package-b in this monorepo, vitest.commandLine is specific with package-a already,
I tried, it failed in package-b.
If you have any idea about this, please. Thanks in advance. Ken
You can try using the vscode workspace to open folders that require different configs. Each folder can have its own .vscode settings.