Open n8allan opened 1 year ago
I'm having the same issue.
vite.config.ts
import { sveltekit } from '@sveltejs/kit/vite';
import type { UserConfig } from 'vite';
const config: UserConfig = {
plugins: [sveltekit()],
test: {
include: ['src/**/*.{test,spec}.{js,ts}']
}
};
export default config;
This should fix it:
For me, it works when using absolute paths like this:
include: [__dirname+'/src/**/*.{test,spec}.{js,ts}']
forked and published my own package given this is not maintained https://marketplace.visualstudio.com/items?itemName=rluvaton.vscode-vitest
My folder structure is like this:
vite.config.js looks like this:
When I click on
Run(Vitest)
from btree.test.ts, the terminal includes a "cd" to the /src/lib/tree folder where npx... is ran. As a result, I get "No test files found". The error says the include issrc/**/*.{test,spec}.{js,ts}
so I assume that the problem is that relative to the path where the test file is, there is indeed no "src" sub-folder.