-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vitest.config.ts
45 lines (39 loc) · 1.73 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
44
45
// ./vitest.config.ts
//
// Root configuration file for the vitest test runner.
// Vitest essential imports.
import tsconfigPaths from "vite-tsconfig-paths";
import { defineConfig } from "vitest/config";
// -----------------------------------------------------------------------------
export default defineConfig({
plugins: [tsconfigPaths()],
test: {
// Test file patterns.
include: [
"scripts/**/*.test.ts",
"src/**/*.test.ts",
"src/**/*.test.tsx",
],
// Disable test file watching.
watch: false,
// Setup files to run before all tests.
setupFiles: ["vitest.setup.ts"],
// Resolve path aliases use in test files for better import readability.
alias:
// biome-ignore format: added alignment for clarity.
{
"@scripts/" : new URL("./scripts/", import.meta.url).pathname,
"@src/" : new URL("./src/", import.meta.url).pathname,
"@app/" : new URL("./src/app/", import.meta.url).pathname,
"@components/": new URL("./src/components/", import.meta.url).pathname,
"@constants/" : new URL("./src/constants/", import.meta.url).pathname,
"@contexts/" : new URL("./src/contexts/", import.meta.url).pathname,
"@guards/" : new URL("./src/guards/", import.meta.url).pathname,
"@handlers/" : new URL("./src/handlers/", import.meta.url).pathname,
"@hooks/" : new URL("./src/hooks/", import.meta.url).pathname,
"@lib/" : new URL("./src/lib/", import.meta.url).pathname,
"@schemas/" : new URL("./src/schemas/", import.meta.url).pathname,
"@utils/" : new URL("./src/utils/", import.meta.url).pathname,
}
}
});