Runs the tests with whichever runner the project configures: vitest or jest.
| Function |
Description |
| detectTestRunner |
Chooses the test runner from the configuration files at the project root. The order is a vitest configuration, then a jest one (a file, or a jest key in package.json). A project with neither gets vitest, the runner every package on this toolchain used before jest was supported. |
| test |
Runs the test suite with the project’s runner. |
| testCoverage |
Runs the test suite with coverage, with the project’s runner. |
| testWatch |
Runs the test suite in watch mode, with the project’s runner. |
| Variable |
Description |
| VITEST_CONFIG_FILE_NAMES |
Every file vitest reads its configuration from. vite.config.* is deliberately not among them: a project that bundles with vite and tests with jest has one. |