This workspace keeps unit tests. Jest has been removed in favor of Vitest:
@angular/build:unit-test builder provided by Angular 22.@nx/vitest
plugin.Use Nx for every task:
# One project
pnpm exec nx test ng-infrastructure
# A single Vitest test file in a TypeScript-only package
pnpm exec nx test core -- src/path/to/file.spec.ts
# Changed projects, as CI does
pnpm exec nx affected -t test --base=origin/main --head=HEAD
The configured test targets do not watch by default, which makes local commands and
CI deterministic. Pass the runner’s watch option only when working interactively.
Only projects with test files expose a native Angular test target. This keeps CI
meaningful while the suite grows; when adding the first Angular test to a package,
add the same @angular/build:unit-test target used by ng-infrastructure and point
it to a dedicated @angular/build:ng-packagr test-build target. TypeScript-only
packages already expose an inferred Vitest target and accept an empty suite.
*.spec.ts or *.test.ts.vi from vitest for mocks and spies when they are necessary. Do not use
Jest globals or Jest-specific configuration.Coverage is available on demand; it is not a blocking global percentage because the
existing suite is still being built out. Run pnpm exec nx test <project> --coverage
when assessing a meaningful change, then raise thresholds only after the relevant
package has stable, representative coverage.