-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.mjs
More file actions
84 lines (82 loc) · 2.52 KB
/
vitest.config.mjs
File metadata and controls
84 lines (82 loc) · 2.52 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import { fileURLToPath } from "node:url";
import { URL } from "url";
import { defineConfig, mergeConfig } from "vite";
import viteConfig from "./vite.config.mjs";
import { configDefaults } from "vitest/config";
export default mergeConfig(
viteConfig,
defineConfig({
plugins: [
{
name: "stub-missing-css",
resolveId(source) {
// If the import path ends with these problem files, grab it!
if (
source.includes("prism-twilight.css") ||
source.includes("window.css")
) {
return "virtual:stub-css";
}
},
load(id) {
// Return empty Javascript for the grabbed files
if (id === "virtual:stub-css") {
return "export default {}";
}
},
},
],
test: {
server: {
deps: {
inline: ["vuetify", "simple-analytics-vue", "vue-gtag"],
},
},
environment: "happy-dom",
globals: true,
setupFiles: ["./tests/setup.js"],
exclude: [...configDefaults.exclude, "e2e/*"],
root: fileURLToPath(new URL("./", import.meta.url)),
transformMode: {
web: [/\.[jt]sx$/],
},
include: ["tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
coverage: {
provider: "v8", // or 'istanbul'
// In v3, 'all' is true by default, which might "drop" your %
// because it now counts untested files.
all: false, // Set to false to match Vitest 2 behavior if preferred
ignoreEmptyLines: true,
reporter: ["html", "lcov", "text", "json-summary"],
thresholds: {
lines: 90,
functions: 90,
branches: 90,
statements: 90,
},
css: true,
exclude: [
"dist/*",
"documentation/*",
"src/documentation/process_doc.js",
"src/store/index.js",
"src/plugins/**",
"src/router/**",
"tests/*",
".eslintrc.cjs",
"babel.config.js",
"vite.config.mjs",
"vitest.config.mjs",
"vue.config.js",
"webpack.config.js",
"views/Records/NetworkGraph.vue",
"src/components/Records/Search/Input/AdvancedSearch/QueryBuilderComponents/index.js",
"src/components/Records/Search/SaveSearch/StepperComponents/index.js",
"src/components/Curators/index.js",
"src/components/Editor/GeneralInformation/BaseFields.vue",
],
reportOnFailure: true,
},
},
}),
);