Review round 1 fallout, all of it verified against real builds: - .dockerignore: `node_modules/` is anchored at the context root and has no implicit `**/` (unlike gitignore), so it never matched frontend/node_modules. `COPY frontend/ ./` was overlaying the Windows host's node_modules on top of what `npm ci` had installed — the image carried @esbuild/win32-x64 and 31 .cmd shims, and the new typecheck ran a tsc resolved from that merged tree. Build context transfer drops 3.05 GB -> 19 kB. Also excludes e2e/.auth (a live Playwright session), the report/result dirs and logs. - build no longer type-checks the e2e project: a type error in a spec must not make the app unbuildable for a self-hoster. The gate still checks it via `npm run typecheck` (now three named lanes). - tsconfig.json references tsconfig.node.json, so editors check vite.config.ts / vitest.config.ts under the same config the gate uses instead of an inferred one. - vitest include accepts .test.tsx: an uncollected test file does not fail, it silently never runs.
17 lines
905 B
TypeScript
17 lines
905 B
TypeScript
import { defineConfig } from "vitest/config";
|
|
|
|
// Unit tests for the pure helpers in src/lib — deliberately separate from vite.config.ts so the
|
|
// production build never has to load vitest. Plain node env (no jsdom): these tests stub the
|
|
// modules that touch the DOM. Browser flows stay in e2e/ under Playwright (`siftlode e2e`).
|
|
// Being its own file means vite.config.ts is NOT merged in — a future test that renders a .tsx
|
|
// component has to wire @vitejs/plugin-react (and a DOM environment) here itself.
|
|
export default defineConfig({
|
|
test: {
|
|
// .tsx included on purpose: a test file the glob misses does not fail, it is simply never
|
|
// collected, and the gate still prints green. (Such a test must still wire plugin-react +
|
|
// a DOM environment here — see above — but at least it will run and say so.)
|
|
include: ["src/**/*.test.{ts,tsx}"],
|
|
environment: "node",
|
|
},
|
|
});
|