Use LiteSVM for tests#12
Open
mikemaccana wants to merge 3 commits into
Open
Conversation
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.
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.
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.mdto standardize Anchor program testing on Rust + LiteSVM (andanchor 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, optionalsolana-kitehelpers, 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.