feat(basics): migrate 5 pilot programs from ts-mocha to tsx + node:test runner#636
Open
NikkiAung wants to merge 1 commit into
Open
feat(basics): migrate 5 pilot programs from ts-mocha to tsx + node:test runner#636NikkiAung wants to merge 1 commit into
NikkiAung wants to merge 1 commit into
Conversation
Greptile SummaryThis PR migrates five pilot programs from ts-mocha to the Node test runner. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "feat(basics): migrate 5 programs from ts..." | Re-trigger Greptile |
…ner (pilot)
Replaces ts-mocha with `tsx --test` as the test runner for the first 5
pilot programs, removing the dead mocha layer that was present alongside
node:test API imports.
Changes per program:
- package.json: swap `test` script to `tsx --test <file>`, drop
mocha/ts-mocha/@types/mocha/chai/@types/chai devDeps, add tsx + @types/node
- tsconfig: update `types` from ["mocha","chai"(,"node")] → ["node"]
- hello-solana/native + counter/native: convert `import { assert } from "chai"`
→ `import assert from "node:assert"` (identical truthy semantics, no call-site edits)
- pnpm-lock.yaml: regenerated per package to reflect new deps
Pilots cover every variant: both tsconfig conventions (root / tests/), both
runtimes (solana-bankrun / litesvm), all 3 CI workflows (native, pinocchio, asm),
and all assertion styles (chai convert, bare throw, node:assert already, none).
No CI workflow changes needed — tests are invoked via the `pnpm test` script
that `build-and-test` already chains into.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NikkiAung
force-pushed
the
feat/node-test-runner
branch
from
July 21, 2026 05:37
81f9b32 to
b898429
Compare
4 tasks
Collaborator
|
the regenerated lockfiles dropped the libc fields on the litesvm Linux packages (they're present on main). Not breaking CI since the runners are glibc, but it can pull the wrong binary on musl/Alpine. Looks like it was regenerated with a pnpm other than the pinned 10.33.0. Can you redo them with: corepack use pnpm@10.33.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
All
basics/native/pinocchio/asm test files already importdescribe/testfromnode:test, yet they're launched throughts-mochawhich contributes nothing —node:testself-registers and auto-runs at process exit. This PR removes the dead mocha launcher and standardises the 5 pilot programs on:tsx --test <file>(matches pattern already in use atgames/world-cup/pinocchio)node:assert(dropchai)@types/nodeonly (drop@types/mocha,@types/chai)Pilot programs (5) — chosen to cover all variants
basics/hello-solana/nativechai→node:assertbasics/counter/nativechai→node:assertbasics/account-data/pinocchiobasics/checking-accounts/asmnode:assert)basics/create-account/nativeChanges per program
package.json—testscript:pnpm ts-mocha -p ... -t 1000000 <file>→tsx --test <file>; dropmocha/ts-mocha/@types/mocha/chai/@types/chai; addtsx ^4.22.0+@types/node ^22.19.1tsconfig.json—types:["mocha","chai"(,"node")]→["node"]hello-solana/native+counter/nativetest files —import { assert } from "chai"→import assert from "node:assert"(identical truthy semantics; no call-site edits)pnpm-lock.yaml— regenerated per package (mocha/chai tree removed, tsx added)No CI workflow changes needed — tests are invoked via the
pnpm testscript thatbuild-and-testalready chains into.Test plan
solana-native.ymlpasses forhello-solana/native,counter/native,create-account/nativesolana-pinocchio.ymlpasses foraccount-data/pinocchiosolana-asm.ymlpasses forchecking-accounts/asmts-mocha,"mocha", orfrom "chai"in the 5 programs