Skip to content

Use LiteSVM for tests#12

Open
mikemaccana wants to merge 3 commits into
quicknode:mainfrom
mikemaccana-edwardbot:edward/rewrite-tests-to-litesvm
Open

Use LiteSVM for tests#12
mikemaccana wants to merge 3 commits into
quicknode:mainfrom
mikemaccana-edwardbot:edward/rewrite-tests-to-litesvm

Conversation

@mikemaccana
Copy link
Copy Markdown
Collaborator

@mikemaccana mikemaccana commented May 18, 2026

Note

Low Risk
Documentation-only changes that adjust contributor guidance around how to run and write tests; no production code paths are modified.

Overview
Updates SKILL.md to standardize Anchor program testing on Rust + LiteSVM (and anchor test) instead of TypeScript/Mocha-era patterns.

Adds detailed guidance for LiteSVM-based integration tests (project init flags, scaffold expectations, post-init fixes like package_manager = "npm" and removing JS test deps, example test structure, optional solana-kite helpers, and common pitfalls like blockhash reuse/account deserialization), and clarifies TypeScript guidance as offchain-only for Anchor programs.

Reviewed by Cursor Bugbot for commit c110b72. Bugbot is set up for automated code reviews on this repo. Configure here.

Edward added 3 commits May 17, 2026 20:02
Anchor 1.0+ ships Rust + LiteSVM tests as the default scaffold from
`anchor init`. Remove the older TypeScript test guidance (node:test via
tsx, @solana/kit, @solana/web3.js, Codama clients for tests, .rpc()).
Document the bare anchor init test pattern, the two scaffold fixes
needed (package_manager = "npm", drop ts-mocha/mocha/chai from
package.json), and the optional solana-kite ergonomic layer used by
quiknode-labs/solana-program-examples.
…t rule

Anchor wraps the test step; running `anchor test` runs the full pipeline
(build → deploy → cargo test) which is what we actually want to verify
green before declaring success. `cargo test` alone misses the
build/deploy step.

The factual references to what's literally in Anchor.toml's [scripts]
section remain as `test = "cargo test"` because that's the actual
default config value.
Mike's phrasing: 'Anchor programs (since 1.0.0) use Rust + LiteSVM
instead of TypeScript' is clearer than 'Anchor program tests are
Rust + LiteSVM' \u2014 it names the version that introduced the change
and explicitly contrasts with the prior TS pattern.
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