-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
64 lines (63 loc) · 1.96 KB
/
Copy pathvitest.config.ts
File metadata and controls
64 lines (63 loc) · 1.96 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
import { resolve } from "node:path";
import { defineConfig } from "vitest/config";
import babel from "@rolldown/plugin-babel";
import { lingui } from "@lingui/vite-plugin";
export default defineConfig({
test: {
globals: true,
// Default 5s is too tight for tests that vi.resetModules() + dynamic-import
// under heavy parallel load. Raise to 15s so import jitter doesn't flake
// the suite; per-test timeouts can still override.
testTimeout: 15_000,
hookTimeout: 15_000,
coverage: {
provider: "v8",
reporter: ["text", "html"],
},
exclude: ["dist", "node_modules"],
projects: [
{
extends: true,
// Expand Lingui macros (Trans/t/msg/useLingui) and resolve `.po` catalog
// imports in the renderer test bundle — the macros throw at runtime if
// left untransformed. (No React Compiler here; it is a build-only
// optimization and unnecessary for tests.)
plugins: [babel({ plugins: ["@lingui/babel-plugin-lingui-macro"] }), lingui()],
resolve: {
alias: {
"@": resolve(import.meta.dirname, "src"),
"~file-icons": resolve(import.meta.dirname, "node_modules/material-icon-theme/icons"),
},
},
test: {
name: "renderer",
include: ["src/renderer/**/*.test.{ts,tsx}"],
environment: "jsdom",
setupFiles: ["./src/renderer/testSetup.ts"],
},
},
{
extends: true,
resolve: {
alias: {
"@": resolve(import.meta.dirname, "src"),
},
},
test: {
name: "node",
include: ["src/**/*.test.{ts,tsx}"],
exclude: ["src/renderer/**/*.test.{ts,tsx}"],
environment: "node",
},
},
{
extends: true,
test: {
name: "packages",
include: ["packages/*/src/**/*.test.{ts,tsx}"],
environment: "node",
},
},
],
},
});