-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvitest.config.ts
More file actions
34 lines (33 loc) · 1.34 KB
/
Copy pathvitest.config.ts
File metadata and controls
34 lines (33 loc) · 1.34 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
import { coverageConfigDefaults, defineConfig } from 'vitest/config';
export default defineConfig({
// Tests acquire their fixtures with `using`. Oxc downlevels `using` to a
// helper from `@oxc-project/runtime` (not a dependency) unless the target
// keeps it native; the test runner is the pinned dev Node, which supports
// it. Only the test transform is affected; the library build has its own
// config and its own, lower, target.
oxc: { target: 'esnext' },
test: {
environment: 'jsdom',
globals: true,
// Test files are being migrated from .js to .ts; match both until the
// migration completes. The playground page (see `demo/playground`) has
// tests of its own; coverage below stays scoped to `src`, so demo code
// never moves the thresholds.
include: ['src/**/*.test.{js,ts}', 'demo/**/*.test.ts'],
// Run the type level tests (`*.test-d.ts`) alongside the runtime ones.
typecheck: { enabled: true },
coverage: {
provider: 'v8',
include: ['src/**/*.{js,ts}'],
// Type level tests hold no runtime code to cover, and the default
// exclusions do not cover the `.test-d.` infix.
exclude: [...coverageConfigDefaults.exclude, '**/*.test-d.{js,ts}'],
thresholds: {
statements: 95,
branches: 90,
functions: 95,
lines: 95,
},
},
},
});