Testing & CI
Test suites
| Command | Scope |
|---|---|
pnpm typecheck | tsc --noEmit over src/. |
pnpm test | Vitest: the telemetry-contract test. |
cargo test --workspace | Rust 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:
| Job | What it does |
|---|---|
typecheck | Runs pnpm typecheck. |
test | Runs Vitest. |
build | Installs Rust + the wasm32-unknown-unknown target + wasm-pack, runs pnpm build, and uploads dist. |
cargo | Runs 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.
Recommended pre-commit check
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.