2026-08-19 00:21:36 +00:00
|
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
|
import path from "node:path";
|
|
|
|
|
|
2026-10-25 21:12:57 +00:00
|
|
|
// React only exposes `act` in its development build, so a shell with
|
|
|
|
|
// NODE_ENV=production would break every component test. Vitest only sets
|
|
|
|
|
// NODE_ENV when it is unset, so force it.
|
2026-10-26 00:22:44 +00:00
|
|
|
//
|
|
|
|
|
// Next's `next/types/global` declares NODE_ENV on ProcessEnv as `readonly`,
|
|
|
|
|
// so a plain `process.env.NODE_ENV = "test"` fails the type check that
|
|
|
|
|
// `next build` runs over this file (tsconfig includes **/*.ts) and takes
|
|
|
|
|
// the whole deployment down. Object.assign has no source-to-target
|
|
|
|
|
// assignability constraint, so it compiles while still writing the value
|
|
|
|
|
// through process.env's setter at runtime.
|
|
|
|
|
Object.assign(process.env, { NODE_ENV: "test" });
|
2026-10-25 21:12:57 +00:00
|
|
|
|
2026-08-19 00:21:36 +00:00
|
|
|
export default defineConfig({
|
|
|
|
|
resolve: {
|
feat(management): store planning data in PocketBase with editable income, add job and forecast vs actual chart
Move the Management planning snapshots into PocketBase collections
(plans, projects, per-year project plans, retention, edit log), loaded
with a bundled-JSON fallback. Admins can double-click an income cell to
enter forecast and actual, edit awarded jobs' planned amounts, change
status and costs, and add jobs, with revision checks and an audit trail.
Income chart now shows forecast and invoiced bars with not-yet-started
money stacked in red; Income is in the sidebar. Adds schema and import
scripts, and jsdom/Testing Library dev dependencies for UI tests.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 01:04:01 +00:00
|
|
|
alias: [
|
|
|
|
|
{ find: "@", replacement: path.resolve(__dirname, "./src") },
|
|
|
|
|
// The `server-only` package ships inside Next.js' compiled dependencies
|
|
|
|
|
// and cannot be resolved by Vitest; point it at an empty stand-in.
|
|
|
|
|
{ find: /^server-only$/, replacement: path.resolve(__dirname, "./src/test-support/server-only.ts") },
|
|
|
|
|
],
|
2026-08-19 00:21:36 +00:00
|
|
|
},
|
|
|
|
|
test: {
|
|
|
|
|
environment: "node",
|
2026-09-19 16:21:45 +00:00
|
|
|
include: ["src/**/*.test.{ts,tsx}"],
|
feat(management): store planning data in PocketBase with editable income, add job and forecast vs actual chart
Move the Management planning snapshots into PocketBase collections
(plans, projects, per-year project plans, retention, edit log), loaded
with a bundled-JSON fallback. Admins can double-click an income cell to
enter forecast and actual, edit awarded jobs' planned amounts, change
status and costs, and add jobs, with revision checks and an audit trail.
Income chart now shows forecast and invoiced bars with not-yet-started
money stacked in red; Income is in the sidebar. Adds schema and import
scripts, and jsdom/Testing Library dev dependencies for UI tests.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 01:04:01 +00:00
|
|
|
// The PDF/PNG split test shells out to poppler; it takes a few seconds on
|
|
|
|
|
// its own and times out when the whole suite runs in parallel.
|
|
|
|
|
testTimeout: 15000,
|
2026-08-19 00:21:36 +00:00
|
|
|
},
|
|
|
|
|
});
|