forked from mswjs/msw
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.mts
More file actions
33 lines (32 loc) · 934 Bytes
/
vitest.config.mts
File metadata and controls
33 lines (32 loc) · 934 Bytes
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
import { defineConfig } from 'vitest/config'
import {
mswExports,
customViteEnvironments,
fromRoot,
} from './test/support/alias'
export default defineConfig({
test: {
globals: true,
// Lookup the unit tests in the "src" directory because
// they are located next to the source code they are testing.
dir: './src',
alias: {
...mswExports,
...customViteEnvironments,
'~/core': fromRoot('src/core'),
},
typecheck: {
// Load the TypeScript configuration to the unit tests.
// Otherwise, Vitest will use the root-level "tsconfig.json",
// which includes way too more than the tests need.
tsconfig: './tsconfig.test.unit.json',
},
environmentOptions: {
jsdom: {
// Drop the 3000 port from the default "location.href"
// for backward-compatibility with the existing tests.
url: 'http://localhost/',
},
},
},
})