Skip to main content
Version: 0.2

Testing & CI

Test suites

CommandScope
pnpm typechecktsc --noEmit over src/.
pnpm testVitest: the telemetry-contract test.
cargo test --workspaceRust unit tests in both crates.

TypeScript typecheck

pnpm typecheck runs tsc --noEmit with the strict settings from tsconfig.json (strict, noImplicitAny, strictNullChecks, etc.). It does not emit output: it only checks types.

Vitest

pnpm test runs Vitest (environment: 'node', includes src/**/*.{test,spec}.ts). The current suite is the telemetry contract:

src/__tests__/telemetry-contract.test.ts

It locks the shape of TelemetrySnapshot so the Rust serialization and the TypeScript type cannot drift apart. If you add a telemetry field on one side without the other, this test fails. See Telemetry.

Vitest coverage uses the v8 provider and excludes rust/**, js/**, and Plans/**.

Rust tests

cargo test --workspace runs the unit tests in both crates:

  • rust/brain_sim: region classification, Bezier endpoint correctness, and signal-pool acquire/release.
  • rust/brain_engine: the standalone scoring heuristics.

Continuous integration

.github/workflows/ci.yml runs on push and PR to main/master/revamp with four jobs:

JobWhat it does
typecheckRuns pnpm typecheck.
testRuns Vitest.
buildInstalls Rust + the wasm32-unknown-unknown target + wasm-pack, runs pnpm build, and uploads dist.
cargoRuns cargo build and cargo test --workspace --locked.

The build job mirrors a clean local build: it provisions the Rust toolchain before building because pnpm build compiles the WASM module first.

Before opening a PR, run all three locally:

pnpm typecheck
pnpm test
cargo test --workspace

For a full end-to-end check that also exercises the WASM and Vite pipeline, run pnpm build.