-
Notifications
You must be signed in to change notification settings - Fork 322
Expand file tree
/
Copy pathvitest.config.ts
More file actions
36 lines (35 loc) · 980 Bytes
/
vitest.config.ts
File metadata and controls
36 lines (35 loc) · 980 Bytes
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
import path from "path";
import fs from "fs";
import { defineConfig } from "vitest/config";
export default defineConfig({
resolve: {
alias: {
"@App": path.resolve(__dirname, "./src"),
"@Packages": path.resolve(__dirname, "./packages"),
"@Tests": path.resolve(__dirname, "./tests"),
"monaco-editor": path.resolve(__dirname, "./tests/mocks/monaco-editor.ts"),
},
},
plugins: [
{
name: "handle-tpl-files",
load(id) {
if (id.endsWith(".tpl")) {
// Return the content as a string asset
const content = fs.readFileSync(id, "utf-8");
return `export default ${JSON.stringify(content)};`;
}
},
},
],
test: {
environment: "jsdom",
exclude: ["e2e/**", "node_modules/**", ".claude/**"],
// List setup file
setupFiles: ["./tests/vitest.setup.ts"],
env: {
VI_TESTING: "true",
SC_RANDOM_KEY: "005a7deb-3a6e-4337-83ea-b9626c02ea38",
},
},
});