-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvitest.config.ts
More file actions
21 lines (19 loc) · 1 KB
/
Copy pathvitest.config.ts
File metadata and controls
21 lines (19 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Pin the timezone before anything reads the clock. One golden-master value (a legacy
// loan's settlement row whose `created` falls back to tstamp(), which parses in local
// time) is timezone-sensitive; the golden fixture is captured under UTC (see
// scripts/capture-golden.mjs, run with TZ=UTC), so the tests must run under UTC too to be
// reproducible on any machine / CI. Everything else is timezone-independent.
process.env.TZ = 'UTC'
import { defineConfig } from 'vitest/config'
// Domain tests are pure TS and run in Node, which provides WebCrypto (crypto.subtle),
// TextEncoder/TextDecoder and btoa/atob natively — no jsdom needed for the modules
// themselves. jsdom is installed for the throwaway golden-master capture harness
// (scripts/capture-golden.mjs), which has to run the DOM-coupled oracle script.
export default defineConfig({
test: {
environment: 'node',
env: { TZ: 'UTC' },
include: ['src/lib/domain/**/*.test.ts'],
exclude: ['node_modules/**', 'dist/**', 'android/**'],
},
})