-
-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathvitest.config.ts
More file actions
28 lines (27 loc) · 774 Bytes
/
Copy pathvitest.config.ts
File metadata and controls
28 lines (27 loc) · 774 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
import { fileURLToPath } from 'node:url';
import { defineConfig } from 'vitest/config';
/**
* Lean Vitest config for unit-testing pure utilities.
*
* * `node` environment only -- no jsdom/chrome/IndexedDB mocks until a test actually needs them.
* * `@showdex/*` is resolved manually (single alias, mirrors `tsconfig.json` `paths`) to sidestep
* the `vite-tsconfig-paths` -> `tsconfck` peer mismatch w/ TypeScript 6.
*
* @since 1.4.0
*/
export default defineConfig({
resolve: {
alias: {
'@showdex': fileURLToPath(new URL('./src', import.meta.url)),
},
},
define: {
__DEV__: 'true',
},
test: {
environment: 'node',
include: ['src/**/*.{test,spec}.{ts,tsx}'],
setupFiles: ['./vitest.setup.ts'],
clearMocks: true,
},
});