Files
build/vitest.config.ts
zeekayandHanzo Dev 1ae5c7fa95 One coverage number from the unit tests and the browser specs, and every screen at four sizes
`pnpm cover` runs vitest and the whole Playwright suite against a dev server
it starts, each keeping raw V8 coverage with the code that ran and its source
map (cover/unit.ts, src/e2e/fixture.ts), and merges them by original source
with monocart into coverage/html, lcov.info and coverage-summary.json, with
every file short of 100% and its unreached lines in coverage/gaps.txt.

Every spec imports its test from fixture.ts, which also holds the one layout
check they share: nothing cut off at the window's edge, no page scrolling
sideways, no control on another. The platform stubs move out of the specs
into stubs.ts, so screens.spec.ts draws every screen and state route.ts names,
signed in and out, at a phone, a tablet, a laptop and a desktop, and saves
each to screens/<size>/<name>.png.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-27 11:33:17 -07:00

13 lines
464 B
TypeScript

import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitest/config'
export default defineConfig({
resolve: { alias: { '~': fileURLToPath(new URL('./src', import.meta.url)) } },
test: {
environment: 'node',
include: ['src/**/*.test.ts', 'src/**/*.test.tsx'],
// `--coverage` keeps raw V8 for `pnpm cover` to merge with the browser's (cover/).
coverage: { provider: 'custom', customProviderModule: './cover/unit.ts' },
},
})