Files
tech-log-frontend/vitest.config.ts
T
DongHyeonkaandClaude Opus 5 afde2b1da1 chore: sync the frontend template from 5434760 to ebea300
Carries 21 template commits: the shared IndexedDB connection/transaction
kernel and the four runtimes moved onto it, the adapter barrel boundary and
the architecture rule that enforces it, the feature adapter contribution
model, `feature-http-binding`, the split of several oversized test files,
and the release identity now derived from the package name.

Product identity is unchanged. The three hard-coded `tech-log-frontend/…`
verifier ids are gone because the template derives them from the package
name and this package is `tech-log-frontend`.

Two decisions worth naming. The platform HTTP executor is the template's
verbatim — it now takes the installed contract so a feature's types flow
through the binding — and TechLog's four gateways, which address operations
by id, reach it through one adapter at the composition root instead of being
rewritten here. And the three derived CI baselines were recomputed from the
merged `config/ci/gates.json` rather than taken from either side: 94 command
definitions, 106 references, 141 artifacts, gate shape `629e5898…`. The
method was checked by first reproducing the pre-merge values from the
pre-merge file.

Verified here: types, lint, architecture, adapter inventory, CI contract,
design system, diagnostics, remediation ledger, browser security and build
all pass; 1789 unit, 152 component, 415 TechLog, 102 integration, 19
reference-feature, 17 recipe and 7 contract tests pass. Five gates stay
red and every one was reproduced at b297d65 first: `check:i18n`,
`check:registries`, `test:runtime-schema`, `verify:documentation` and
`test:sample-removal`.

Full decision record, including what was deliberately not carried and the
five open follow-ups, in `docs/operations/template-sync-2026-09-21.md`.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 16:31:05 +09:00

45 lines
1.8 KiB
TypeScript

import { configDefaults, defineConfig } from "vitest/config";
// Tests must not inherit a caller's production React/runtime selection.
// Package scripts also launch Vitest through scripts/run-vitest.ts, which owns
// NODE_ENV before the Vitest process starts. Keeping the config deterministic
// protects direct `vitest` invocations as well.
process.env.NODE_ENV = "test";
export default defineConfig({
test: {
globals: false,
setupFiles: ["./tests/setup.ts"],
restoreMocks: true,
clearMocks: true,
mockReset: true,
testTimeout: 10_000,
// A runaway serialization inside a worker (the classic case: an assertion
// library inspecting a React-rendered DOM node, whose `__reactFiber$*`
// graph re-expands per traversal path) allocates until the machine's OOM
// killer takes the whole run down -- 29.5GB and ~40s here, reported as a
// bare "worker exited" with no failing test named. Capping the worker's
// old-space turns that into a `Reached heap limit` abort in ~3s, next to
// the file that caused it. The ceiling is chosen well above real demand:
// the heaviest suite (`tests/unit`, 126 files) peaks near 1.3GB RSS, of
// which old-space is only a fraction.
execArgv: ["--max-old-space-size=2048"],
exclude: [
...configDefaults.exclude,
".tmp/**",
// A git worktree inside the repository is a different checkout of a
// different branch. Running its tests against this checkout's config
// reports failures that belong to neither.
".worktrees/**",
"tests/fixtures/v8-coverage-counter-semantics/**",
],
coverage: {
provider: "v8",
reportsDirectory: "artifacts/tests/coverage",
reporter: ["text", "json-summary", "lcov"],
include: ["src/**/*.{ts,tsx}"],
exclude: ["**/*.d.ts", "**/*.stories.*"],
},
},
});