-
Notifications
You must be signed in to change notification settings - Fork 7
/
vitest.config.ts
43 lines (42 loc) · 1.17 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
39
40
41
42
43
import { sveltekit } from "@sveltejs/kit/vite";
import { resolve } from "path";
import type { UserConfig } from "vite";
import { defineConfig } from "vitest/config";
export default defineConfig(
(): UserConfig => ({
plugins: [sveltekit()],
resolve: {
alias: [
{
find: "$lib",
replacement: resolve(__dirname, "src/lib"),
},
{
find: "$routes",
replacement: resolve(__dirname, "src/routes"),
},
{
find: "$tests",
replacement: resolve(__dirname, "src/tests"),
},
{
find: "$docs",
replacement: resolve(__dirname, "src/docs"),
},
// vitest issue https://github.com/vitest-dev/vitest/issues/2834#issuecomment-1425371719
{
find: /svelte\/ssr.mjs/,
replacement: "svelte/index.mjs",
},
],
},
test: {
environment: "jsdom",
globals: true,
watch: false,
setupFiles: ["./vitest.setup.ts"],
// Vitest issue: https://github.com/vitest-dev/vitest/issues/2834#issuecomment-1439576110
alias: [{ find: /^svelte$/, replacement: "svelte/internal" }],
},
}),
);