-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathvitest.config.ts
More file actions
30 lines (29 loc) · 1.5 KB
/
Copy pathvitest.config.ts
File metadata and controls
30 lines (29 loc) · 1.5 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
import { defineConfig } from 'vitest/config'
// Vitest runs three very different suites:
// tests/tokenizer — offline unit tests for the hand-rolled BPE tokenizer,
// pinned against HuggingFace-generated fixtures
// (`npm run test:unit`).
// tests/unit — offline unit tests for pure loader helpers
// (mapLimited download semantics; `npm run test:unit`).
// tests/e2e — Puppeteer-driven e2e tests that boot a real Vite dev
// server + Chrome with WebGPU and exercise the full
// chat + validate pages (`npm run test:e2e`).
// Per-kernel GPU correctness lives outside vitest in tests/kernels
// (`npm run test:kernels`).
export default defineConfig({
test: {
include: ['tests/tokenizer/**/*.test.ts', 'tests/unit/**/*.test.ts', 'tests/e2e/**/*.test.ts'],
// First e2e run downloads ~2GB of Phi-3 weights from HuggingFace into the
// test browser profile. Subsequent runs use the cached profile and finish
// in well under a minute. (The tokenizer unit tests finish in seconds.)
testTimeout: 6 * 60 * 1000,
hookTimeout: 6 * 60 * 1000,
// The e2e tests share a single browser + dev server, so they cannot run
// in parallel against each other.
fileParallelism: false,
sequence: { concurrent: false },
// Print console.log from tests so cold-start timings are visible in the
// terminal output, not just in failed-assertion messages.
silent: false,
},
})