M31A uses Vitest across workspace packages plus several specialized suites.
Unit tests
bash
npm run test # all workspace tests + SEA launch test
npm run test:ci # CI variant, also runs script tests
npm run test:scripts # tests under scripts/tests
npm run test:sea-launch # SEA launcher smoke testRun a single workspace test file:
bash
npm test -w @m31a/core -- src/routing/modelRouterService.test.tsposttest runs npm run build after the default test command.
Integration tests
bash
npm run test:e2e # sandbox disabled, verbose
npm run test:integration:sandbox:none
npm run test:integration:sandbox:docker
npm run test:integration:sandbox:podman
npm run test:integration:all
npm run test:integration:flakyIntegration tests live in tests/integration-tests/. The Docker and Podman variants require the corresponding runtime and build the sandbox image first. Install bubblewrap on Linux if your environment requires user-namespace isolation.
Evaluations
bash
npm run test:always_passing_evals
npm run test:all_evals
npm run eval:validate
npm run eval:inventory
npm run eval:report
npm run eval:coverageEval definitions live in tests/evals/. Live API tests require NVIDIA_API_KEY to be configured as a repository secret in forks.
Performance and memory
bash
npm run test:perf
npm run test:perf:update-baselines
npm run test:memory
npm run test:memory:update-baselinesThese suites live in tests/perf-tests/ and tests/memory-tests/.
Flaky test tooling
bash
npm run deflake
npm run deflake:test:integration:sandbox:none
npm run deflake:test:integration:sandbox:dockerTypecheck and lint
bash
npm run typecheck
npm run lint
npm run lint:all
node scripts/lint.js --actionlint --yamllint
node scripts/lint.js --check-github-actions-pinningGitHub Actions must be pinned to 40-character commit SHAs.
Conventions
- Stub environment variables with
vi.stubEnv('NAME', 'value')inbeforeEachand restore withvi.unstubAllEnvs()inafterEach. - Keep tests scoped to their workspace package.
- Run
npm run preflightbefore submitting a pull request.
Next steps
See Development and the root CONTRIBUTING.md.