Skip to content

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 test

Run a single workspace test file:

bash
npm test -w @m31a/core -- src/routing/modelRouterService.test.ts

posttest 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:flaky

Integration 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:coverage

Eval 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-baselines

These 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:docker

Typecheck 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-pinning

GitHub Actions must be pinned to 40-character commit SHAs.

Conventions ​

  • Stub environment variables with vi.stubEnv('NAME', 'value') in beforeEach and restore with vi.unstubAllEnvs() in afterEach.
  • Keep tests scoped to their workspace package.
  • Run npm run preflight before submitting a pull request.

Next steps ​

See Development and the root CONTRIBUTING.md.

Built with VitePress. Powered by NVIDIA NIM.