Skip to content

chore: switch the test runner to vitest - #4

Merged
FRSgit merged 3 commits into
mainfrom
chore/vitest
Oct 7, 2026
Merged

FRSgit merged 3 commits into
mainfrom
chore/vitest

Conversation

@FRSgit

@FRSgit FRSgit commented Oct 7, 2026

Copy link
Copy Markdown
Member

Stacked on #3 (merge that first; GitHub retargets this one to main when the base branch is deleted).

Why

The binding rewrite tracked for 1.0 needs type tests (*.test-d.ts with expectTypeOf / @ts-expect-error), inline snapshots for event records and a bench runner. vitest provides all three and is what @frsource/babylon-box3d already uses, so contributors switching between the two repos keep one toolset. Changing the runner in its own PR keeps a later failure attributable.

What

  • vitest@5.0.3 devDependency (exact pin, repo style).
  • vitest.config.ts: runtime tests from test/**, typecheck project enabled for test/**/*.test-d.ts (no files yet).
  • The three test files import test from vitest instead of node:test; assertions unchanged (node:assert/strict).
  • Scripts: test → vitest run, new test:dev → vitest.

Verification

  • pnpm test: 3 files, 23 tests passing, type errors none, ~0.8 s; the threaded build does not keep the process alive.
  • pnpm lint clean.

🤖 Generated with Claude Code

FRSgit and others added 2 commits October 7, 2026 17:18
The /iso entry was upstream's experiment for sharing one TypeScript
frontend with a native host (scriptc-game): csrc/flat.cpp with fixed
16384-slot tables and a single-world assumption, src/frontend.ts built
with a tsc --ignoreConfig hack, and a v0 surface (world, body, box,
sphere) that nothing outside the repo's own test consumed. It also leaked
the _b3f_* exports into the generated declarations.

The fork's public API is the embind surface (soon a flat C ABI with its
own TypeScript frontend), so the layer is dropped: files, the ./iso
package export, the build step and the README section.

BREAKING CHANGE: the `@frsource/box3d-wasm/iso` entry no longer exists.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Same three test files, same assertions; only the runner import changes.
vitest brings the typecheck project (test/**/*.test-d.ts, empty for now)
that the upcoming TypeScript frontend uses for its type tests, inline
snapshots for event records, and the bench runner, and it matches the
toolset of @frsource/babylon-box3d.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Base automatically changed from chore/remove-iso-layer to main October 7, 2026 20:07
…loy (#5)

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
@FRSgit
FRSgit marked this pull request as ready for review October 7, 2026 20:07
@FRSgit
FRSgit merged commit 01d0b07 into main Oct 7, 2026
1 check passed
@FRSgit
FRSgit deleted the chore/vitest branch October 7, 2026 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant