Workspace tests
Run all test targets with the Nx cache disabled:Test one project
Thetest:unit wrapper forwards its trailing target and flags to nx run:
Run all tests directly through Nx
Test layout
Test files match either of these Jest patterns:jest.config.tstsconfig.spec.json- an Nx
testtarget inproject.json
coverage/ according to each project target’s configured output path.
Completion gate
verify runs affected lint, typecheck, and test targets. Because it is affected-only, use a targeted project test or the all-project command when you need explicit full-suite coverage.
Writing reliable tests
- Test observable state and behavior rather than implementation details.
- Prefer actual Zustand state transitions when testing stores.
- Inject network dependencies so tests can replace them with typed mocks.
- Cover error and boundary paths as well as successful paths.
- Keep fixtures deterministic and local to the project that owns the behavior.