Skip to content

Commit 286864d

Browse files
committed
chore: extract vitest config into separate file
1 parent dd19e77 commit 286864d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

vite.config.ts

-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import vue from "@vitejs/plugin-vue";
2-
/// <reference types="vite/client" />
3-
/// <reference types="vitest" />
42
import { fileURLToPath, URL } from "url";
53
import { defineConfig } from "vite";
64
import dts from "vite-plugin-dts";
@@ -153,10 +151,4 @@ export default defineConfig({
153151
},
154152
},
155153
},
156-
test: {
157-
environment: "jsdom",
158-
coverage: {
159-
reporter: ["text", "json", "html"],
160-
},
161-
},
162154
});

vitest.config.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { fileURLToPath } from "node:url";
2+
import { mergeConfig, defineConfig, configDefaults } from "vitest/config";
3+
import viteConfig from "./vite.config";
4+
5+
export default mergeConfig(
6+
viteConfig,
7+
defineConfig({
8+
test: {
9+
environment: "jsdom",
10+
exclude: [...configDefaults.exclude, "tests/*"],
11+
root: fileURLToPath(new URL("./", import.meta.url)),
12+
coverage: {
13+
provider: "v8",
14+
reporter: ["text", "json", "html"],
15+
},
16+
},
17+
}),
18+
);

0 commit comments

Comments
 (0)