Running tests
API tests use Jest with config test/jest.json. AGENTS.md places feature specs under test/modules/.
cd pnxt-api-nestjs
yarn test
yarn test:cov
yarn test:debug
yarn verify
yarn architecture:check
yarn verify:test-pairs
| Script | What it runs |
|---|---|
yarn test | Jest --passWithNoTests --forceExit |
yarn test:cov | Jest with coverage |
yarn test:debug | Jest under --inspect-brk, --runInBand |
yarn verify | lint, Prettier check, typecheck, nest build, test |
yarn architecture:check | Module boundary ratchet (scripts/architecture/check.mjs) |
yarn verify:test-pairs | Fails when a feature has no paired test |
pretest generates the Prisma client. Pre-commit uses lint-staged (Prettier and ESLint) via Husky.
Admin uses Vitest (pnpm verify in pnxt-admin). The warehouse package.json that was read has no test script.
CI workflows exist at pnxt-api-nestjs/.github/workflows/test.yml and deploy.yml. Read those files for the current steps. This page does not restate them, because they drift.
What the architecture check is for
It guards the rules in Conventions: feature modules must not import area modules, cycles, and concrete integration imports. A new Prisma model that is missing from the tenancy extension fails test/architecture/backend-architecture.spec.ts (stated in docs/AI_CONTEXT.md).