-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Expand file tree
/
Copy pathvitest.config.ts
More file actions
30 lines (29 loc) · 1.09 KB
/
Copy pathvitest.config.ts
File metadata and controls
30 lines (29 loc) · 1.09 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
import { defineConfig } from 'vitest/config';
export default defineConfig({
// Vite 8 transforms with oxc, which defaults to TC39 decorators. core/ is compiled with
// experimentalDecorators, so the transform has to be told. No emitDecoratorMetadata needed:
// @Cordova and @Plugin are declaration-only types the build strips, nothing reads design:type.
oxc: {
decorator: { legacy: true },
},
test: {
// core/ reads window and window.document; the decorators register listeners on them
environment: 'jsdom',
globals: true,
include: ['src/**/*.spec.ts', 'scripts/**/*.spec.ts'],
coverage: {
provider: 'v8',
reporter: ['text', 'lcov'],
// Only core/ is meaningfully testable. The 266 plugin wrappers are decorator stubs whose
// bodies the build replaces, so there is nothing of their own to exercise.
include: ['src/@awesome-cordova-plugins/core/**/*.ts'],
exclude: ['**/*.spec.ts', '**/interfaces.ts'],
thresholds: {
statements: 100,
branches: 100,
functions: 100,
lines: 100,
},
},
},
});