TaxPilot

Search the docs

Search the Help centre, Developer docs and Legal centre.

Open TaxPilot

Testing

Run the engine, web and Playwright suites, know what each covers, and add the right tests for a change without overloading your machine.

Updated November 22, 2026

There are three test layers: vitest in packages/t2 for the engine and rules, vitest in apps/web for view models, parsing and PDFs, and Playwright in apps/web/e2e for the app in a real browser. CI runs all three on every push to main or dev and on pull requests.

Commands

Terminal
pnpm --filter @workspace/t2 test     # engine, scenarios, releases
pnpm --filter web test               # web view models, PDF, parsing, docs
pnpm test:e2e                        # Playwright (reuses the dev server on :3000)
pnpm --filter web test:walk          # the long filing-combination walk-through
pnpm typecheck && pnpm lint

Both vitest configs set NEXT_PUBLIC_RULES_CHANNEL: "dev", so tests can select the draft 2026.1 release. The web config includes test/**/*.test.{ts,tsx} and maps @ to the app root.

Engine tests (packages/t2/test)

Release-sensitive tests use the approved fixture 2026.1a-test. Register your own fixture with registerTestRelease(r, { approvedBy }); its id must end in -test.

Web tests (apps/web/test)

These cover pure modules: store-persist.test.ts and store-seed.test.ts (persistence and the seed), return-status.test.ts, work-queue.test.ts, xlsx-import.test.ts, pdf.test.tsx (set PDF_OUT=<dir> to keep the files), compliance.test.ts, and docs.test.ts for the reference content. Keep logic out of components so it can be tested here.

Playwright (apps/web/e2e)

playwright.config.ts runs with two workers against one server. Locally it reuses the dev server on port 3000; in CI it serves the production build on port 3100. Projects:

Key specs: golden-path.spec.ts (the core journey; the filing step is skipped while 2026.1 is a draft), forms.spec.ts with form-cases.ts, at1.spec.ts, a11y.spec.ts (axe checks), layout-stability.spec.ts, overlays.spec.ts and reference-pages.spec.ts. Shared setup is in fixtures.ts. Failures keep a trace in e2e/.results.

What to add for a change

Before you call UI work done, take screenshots at phone and desktop widths in both themes and look at them.