-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathvitest.workspace.ts
More file actions
37 lines (35 loc) · 1.01 KB
/
Copy pathvitest.workspace.ts
File metadata and controls
37 lines (35 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { fileURLToPath } from 'node:url';
import { defineWorkspace } from 'vitest/config';
export default defineWorkspace([
{
// The unit project doesn't run the SvelteKit plugin, so `$lib` imports
// (e.g. file-transfer.ts -> $lib/api) need resolving by hand.
resolve: {
alias: {
$lib: fileURLToPath(new URL('./src/lib', import.meta.url))
}
},
test: {
// an example of file based convention,
// you don't have to follow it
// include: ['tests/unit/**/*.{test,spec}.ts', 'tests/**/*.unit.{test,spec}.ts'],
include: ['src/**/*.{test,spec}.{js,ts}'],
exclude: ['src/**/*browser*.{test,spec}.{js,ts}'],
name: 'unit',
environment: 'node'
}
},
{
test: {
// an example of file based convention,
// you don't have to follow it
// include: ['tests/browser/**/*.{test,spec}.ts', 'tests/**/*.browser.{test,spec}.ts'],
include: ['src/**/*.browser.{test,spec}.{js,ts}'],
name: 'browser',
browser: {
enabled: true,
instances: [{ browser: 'chromium' }]
}
}
}
]);