forked from cloudflare/vinext
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
24 lines (23 loc) · 973 Bytes
/
vitest.config.ts
File metadata and controls
24 lines (23 loc) · 973 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
import { randomUUID } from "node:crypto";
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
include: ["tests/**/*.test.ts"],
testTimeout: 30000,
env: {
// Mirrors the Vite `define` in index.ts that inlines a build-time UUID.
// Setting it here means tests exercise the same code path as production.
__VINEXT_DRAFT_SECRET: randomUUID(),
},
// Multiple suites spin up Vite dev servers against the same fixture dirs.
// Running test files in parallel can race on Vite's deps optimizer cache
// (node_modules/.vite/*) and produce "outdated pre-bundle" 500s.
fileParallelism: false,
// GitHub Actions reporter adds inline failure annotations in PR diffs.
// It's auto-enabled with the default reporter, but being explicit ensures
// it survives any future reporter config changes.
reporters: process.env.CI
? ["default", "github-actions"]
: ["default"],
},
});