Skip to content

Commit

Permalink
Added intorduction to MultiTest.
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszDepta committed Jul 15, 2024
1 parent 22c0b88 commit f99f3a9
Show file tree
Hide file tree
Showing 13 changed files with 84 additions and 106 deletions.
13 changes: 0 additions & 13 deletions src/pages/cw-multi-test.md

This file was deleted.

37 changes: 37 additions & 0 deletions src/pages/cw-multi-test.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
---
tags: ["multitest"]
---

import { Callout } from "nextra/components";

# Introduction

`MultiTest` is a suite of testing tools designed for facilitating multi-contract
interactions within the CosmWasm ecosystem. Its primary focus is on providing
developers with a robust framework for testing complex contract interactions and
several Cosmos modules operations.

<Callout type="info">
MultiTest is a **simulator** of the blockchain, allowing tested smart
contracts to interact as if they were operating on the real-life blockchain.
</Callout>

The most valuable advantage of using `MultiTest` is that it allows you to test
and debug smart contracts with access to Rust source code, eliminating the need
to run a complete blockchain node to begin designing smart contract
functionality.

The disadvantage is that `MultiTest` is a blockchain simulator, and it is
possible that the behavior of the real-life blockchain may slightly differ in
edge cases from the simulated model. In such cases, we strongly encourage you to
[file an issue](https://github.com/CosmWasm/cw-multi-test/issues) with a
detailed description of the use case to help us improve `MultiTest`.

In the upcoming chapters, we will provide detailed instructions on installing
and getting started with `MultiTest`, writing unit tests for smart contracts,
testing complex interactions between smart contracts and testing smart contract
interactions with Cosmos modules.

By the end of these chapters, you will have a comprehensive understanding of
using `MultiTest` for testing and debugging smart contracts in various
scenarios.
5 changes: 1 addition & 4 deletions src/pages/cw-multi-test/_meta.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
{
"installation": "Installation",
"getting-started": "Getting started",
"smart-contract-lifetime": "Smart contract lifetime",
"examples": "Examples"
"installation": "Installation"
}
3 changes: 0 additions & 3 deletions src/pages/cw-multi-test/examples/_meta.json

This file was deleted.

7 changes: 0 additions & 7 deletions src/pages/cw-multi-test/examples/advanced.md

This file was deleted.

9 changes: 0 additions & 9 deletions src/pages/cw-multi-test/getting-started.md

This file was deleted.

10 changes: 0 additions & 10 deletions src/pages/cw-multi-test/installation.md

This file was deleted.

46 changes: 46 additions & 0 deletions src/pages/cw-multi-test/installation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
tags: ["multitest"]
---

import { Callout } from "nextra/components";

# Installation

`MultiTest` ships as a Rust library named
[cw-multi-test](https://crates.io/crates/cw-multi-test).

To use `MultiTest` for building and testing smart contracts, add it as a
**development dependency** to your project:

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

<Callout type="warning">
`MultiTest` is a **development** library, and should always be added to your
project as a **development dependency** in section **`[dev-dependencies]`** of
the Cargo.toml file.
</Callout>

### Prerequisities

The only prerequisite to build and test smart contracts using `MultiTest` is
having [Rust and Cargo](https://www.rust-lang.org/tools/install) installed.

Optionally, you may want to install
[Tarpaulin](https://github.com/xd009642/tarpaulin) for measuring code coverage
and [Nextest](https://nexte.st) for running tests faster, with clean and
beautiful user interface.

Installing **Tarpaulin**:

```shell
cargo install cargo-tarpaulin
```

Installing **Nextest**:

```shell
cargo install cargo-nextest
```
6 changes: 0 additions & 6 deletions src/pages/cw-multi-test/smart-contract-lifetime/_meta.json

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f99f3a9

Please sign in to comment.