Skip to content

Commit

Permalink
Updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
DariuszDepta committed Sep 5, 2024
1 parent 78ba426 commit 0081b9a
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/pages/cw-multi-test/getting-started/writing-tests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Having the **counter** smart contract set up, let's first check if the project c
cargo build
```

```ansi
```ansi filename="OUTPUT"
 Updating crates.io index
  Locking 112 packages to latest compatible versions
    ⋮
Expand Down Expand Up @@ -118,7 +118,7 @@ cargo test

The expected output should be similar to the one shown below:

```ansi {6,12,16} showLineNumbers
```ansi {6,12,16} showLineNumbers filename="OUTPUT"
Finished `test` profile [unoptimized + debuginfo] target(s) in 17.96s
Running unittests src/lib.rs (target/debug/deps/counter-f350df45a1cd1c74)
Expand Down Expand Up @@ -153,18 +153,19 @@ cargo nextest run

The expected output is:

```ansi {4} showLineNumbers
```ansi {4} showLineNumbers filename="OUTPUT"
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.06s
Starting 0 tests across 2 binaries (run ID: 3e0cbabb-3ef9-4b2f-98a8-d375bc510845, nextest profile: default)
------------
Summary [ 0.000s] 0 tests run: 0 passed, 0 skipped
```

[cargo-nextest](https://nexte.st) reports in a user-friendly manner that there were no tests to run.
[cargo-nextest](https://nexte.st) reports in a user-friendly manner that there were no tests to run
**\<line 4\>**.

Now, you have almost everything you need to start testing the counter smart contract. What’s left is
to prepare tools for measuring code coverage, which is a handy way to track progress in writing
tests.
Now, you have almost everything you need to start testing the **counter** smart contract. What’s
left is to prepare tools for measuring code coverage, which is a handy way to track progress in
writing tests.

## Preparing code coverage script

Expand Down Expand Up @@ -217,7 +218,7 @@ tree
        └── test_counter.rs
```

## Measuring the code coverage
## Measuring code coverage

With the code coverage script at hand, measuring code coverage is now as simple as typing:

Expand All @@ -227,7 +228,7 @@ With the code coverage script at hand, measuring code coverage is now as simple

The result should be similar to this (only the last few lines are shown):

```ansi
```ansi filename="OUTPUT"
|| Tested/Total Lines:
|| src/contract.rs: 0/18
Expand Down

0 comments on commit 0081b9a

Please sign in to comment.