Overview
LiteSVM is a lightweight library for testing Solana Programs that works by creating an in-process Solana VM optimized for program developers. Unlike other testing approaches that spin up separate validator processes, LiteSVM embeds the VM inside your tests, making them execute much faster. In a further break from tradition, it has an ergonomic API with sane defaults and extensive configurability for those who want it.
Installation
Install LiteSVM Core Library
Essential testing framework
crates.io
cargo add --dev litesvmAdd LiteSVM Utils
Additional helper utilities
crates.io
cargo add --dev litesvm-utilsAdd SPL Token Support
Token program utilities
crates.io
cargo add --dev litesvm-tokenAdd Anchor Support
Testing utilities for Anchor programs
crates.io
cargo add --dev anchor-litesvmInstall LiteSVM Kit Plugin
LiteSVM plugin for @solana/kit
npm
pnpm install @solana/kit-plugin-litesvm @solana/kit