|
| 1 | +--- |
| 2 | +sidebar_position: 1 |
| 3 | +--- |
| 4 | + |
| 5 | +# Installation |
| 6 | + |
| 7 | +**MultiTest** is as a [Rust] library named [cw-multi-test] and is hosted on [crates.io]. |
| 8 | + |
| 9 | +## Usage |
| 10 | + |
| 11 | +To use **MultiTest** in your project, simply add it as a **development dependency** to **Cargo.toml** file: |
| 12 | + |
| 13 | +```toml title="Cargo.toml" |
| 14 | +[dev-dependencies] |
| 15 | +cw-multi-test = "3" |
| 16 | +``` |
| 17 | + |
| 18 | +:::warning |
| 19 | + |
| 20 | +**MultiTest** is a **TESTING** library and should **ALWAYS** be added to your project |
| 21 | +as a **DEVELOPMENT DEPENDENCY** in section **`[dev-dependencies]`** of the **Cargo.toml** file. |
| 22 | + |
| 23 | +**MultiTest** <u>**IS NOT**</u> designed to be used in production code on a real-life blockchain. |
| 24 | + |
| 25 | +::: |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +### Rust and Cargo |
| 30 | + |
| 31 | +The only prerequisite to test smart contracts using **MultiTest** is having [Rust and Cargo] installed. |
| 32 | + |
| 33 | +:::info |
| 34 | + |
| 35 | +We recommend installing Rust using the official [rustup installer]. This makes it easy |
| 36 | +to stay on the most recent version of Rust and Cargo. |
| 37 | + |
| 38 | +::: |
| 39 | + |
| 40 | +### Tarpaulin and cargo-nextest |
| 41 | + |
| 42 | +Optionally, you may want to install [Tarpaulin] for measuring code coverage, and [cargo-nextest] for |
| 43 | +running tests faster with a clean and beautiful user interface. |
| 44 | + |
| 45 | +Installing **Tarpaulin**: |
| 46 | + |
| 47 | +```shell |
| 48 | +cargo install cargo-tarpaulin |
| 49 | +``` |
| 50 | + |
| 51 | +Installing **cargo-nextest**: |
| 52 | + |
| 53 | +```shell |
| 54 | +cargo install cargo-nextest |
| 55 | +``` |
| 56 | + |
| 57 | +[rustup installer]: https://rustup.rs |
| 58 | +[Rust and Cargo]: https://www.rust-lang.org/tools/install |
| 59 | +[Rust]: https://www.rust-lang.org |
| 60 | +[Tarpaulin]: https://github.com/xd009642/tarpaulin |
| 61 | +[cargo-nextest]: https://nexte.st |
| 62 | +[cw-multi-test]: https://crates.io/crates/cw-multi-test |
| 63 | +[crates.io]: https://crates.io |
0 commit comments