TestSVM provides:
- Account labeling and logging, so you can easily track what
Pubkey
maps to what account. - Assertions for transaction results: assert that a transaction fails with a specific error, or that it succeeds.
- Nicely formatted transaction logs with account labeling, so you know what accounts have issues in a transaction.
- Type-safe utilities for validating state and loading it from the SVM.
Built on top of LiteSVM, tests written using TestSVM are an order of magnitude faster than traditional solana-test-validator
+ JavaScript tests.
Note: this is a work in progress and is subject to change.
The testsvm-quarry
crate contains a number of tests that demonstrate all TestSVM features in tests/.
I plan to add more examples in the future.
There are two main crates that compose TestSVM:
testsvm
- Core testing frameworktestsvm-quarry
- Helpers for testing programs that integrate with Quarry
The following crates are used internally by TestSVM, but are not documented or intended for public use.
solana-address-book
- Keeps track of all the addresses used in the testsanchor-utils
- Lightweight utilities for interacting with programs that use Anchor.
Below is a screenshot of what happens when a test fails: detailed labels and logs of what accounts were involved in the transaction, what accounts were writable, and what error was thrown.
Copyright (c) 2025 Ian Macalinao. Licensed under the Apache License, Version 2.0.