Installation

Installation

MultiTest is as a Rust (opens in a new tab) library named cw-multi-test (opens in a new tab), and is hosted on crates.io (opens in a new tab).

Usage

To use MultiTest in your project, simply add it as a development dependency to Cargo.toml file:

Cargo.toml
[dev-dependencies]
cw-multi-test = "2"
🚨

MultiTest is a TESTING library and should ALWAYS be added to your project as a DEVELOPMENT DEPENDENCY in section [dev-dependencies] of the Cargo.toml file.

🚨

MultiTest IS NOT designed to be used in production code on a real-life blockchain.

Prerequisites

Rust and Cargo

The only prerequisite to test smart contracts using MultiTest is having Rust and Cargo (opens in a new tab) installed.

We recommend installing Rust using the official rustup installer (opens in a new tab). This makes it easy to stay on the most recent version of Rust and Cargo.

Tarpaulin and cargo-nextest

Optionally, you may want to install Tarpaulin (opens in a new tab) for measuring code coverage, and cargo-nextest (opens in a new tab) for running tests faster with a clean and beautiful user interface.

Installing Tarpaulin:

TERMINAL
cargo install cargo-tarpaulin

Installing cargo-nextest:

TERMINAL
cargo install cargo-nextest