-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvitest.config.ts
38 lines (37 loc) · 1 KB
/
vitest.config.ts
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
38
import { defineVitestConfig } from "@nuxt/test-utils/config";
import { configDefaults } from "vitest/config";
export default defineVitestConfig({
// any custom Vitest config you require
test: {
environment: "nuxt",
environmentOptions: {
nuxt: {
domEnvironment: "jsdom",
},
},
reporters: ["default", "html"],
include: ["**/*.test.ts"],
coverage: {
enabled: true,
provider: "v8",
clean: true,
cleanOnRerun: true,
reporter: ["text", "json", "html", "lcov"],
//if coverage does not meet thresholds, test will fail and build process will be aborted
// thresholds: {
// statements: 90,
// branches: 90,
// functions: 90,
// lines: 90,
// },
exclude: [
...(configDefaults.coverage.exclude as string[]),
"nuxt/**",
"html/**/*",
"**/*.config.{ts,js}",
],
//if true report will be generated even if tests fail
reportOnFailure: true,
},
},
});