Skip to content

Commit 99ac2b0

Browse files
Updating unit testing page (#430)
* Updates * Update spacing
1 parent 0b4a81c commit 99ac2b0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

website/pages/en/developing/unit-testing-framework.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ graph test path/to/file.test.ts
105105
```sh
106106
-c, --coverage Run the tests in coverage mode
107107
-d, --docker Run the tests in a docker container (Note: Please execute from the root folder of the subgraph)
108-
-f --force Binary: Redownloads the binary. Docker: Redownloads the Dockerfile and rebuilds the docker image.
108+
-f, --force Binary: Redownloads the binary. Docker: Redownloads the Dockerfile and rebuilds the docker image.
109109
-h, --help Show usage information
110110
-l, --logs Logs to the console information about the OS, CPU model and download url (debugging purposes)
111111
-r, --recompile Forces tests to be recompiled
@@ -990,9 +990,9 @@ Notice that dataSourceMock.resetValues() is called at the end. That's because th
990990

991991
## Test Coverage
992992

993-
Using **Matchstick**, subgraph developers are able to run a script that will calculate the test coverage of the written unit tests. The tool only works on **Linux** and **MacOS**, but when we add support for Docker (see progress on that [here](https://github.com/LimeChain/matchstick/issues/222)) users should be able to use it on any machine and almost any OS.
993+
Using **Matchstick**, subgraph developers are able to run a script that will calculate the test coverage of the written unit tests.
994994

995-
The test coverage tool is really simple - it takes the compiled test `wasm` binaries and converts them to `wat` files, which can then be easily inspected to see whether or not the handlers defined in `subgraph.yaml` have actually been called. Since code coverage (and testing as whole) is in very early stages in AssemblyScript and WebAssembly, **Matchstick** cannot check for branch coverage. Instead we rely on the assertion that if a given handler has been called, the event/function for it have been properly mocked.
995+
The test coverage tool takes the compiled test `wasm` binaries and converts them to `wat` files, which can then be easily inspected to see whether or not the handlers defined in `subgraph.yaml` have been called. Since code coverage (and testing as whole) is in very early stages in AssemblyScript and WebAssembly, **Matchstick** cannot check for branch coverage. Instead we rely on the assertion that if a given handler has been called, the event/function for it have been properly mocked.
996996

997997
### Prerequisites
998998

@@ -1029,7 +1029,7 @@ You could also add a custom `coverage` command to your `package.json` file, like
10291029
},
10301030
```
10311031

1032-
Hopefully that should execute the coverage tool without any issues. You should see something like this in the terminal:
1032+
That will execute the coverage tool and you should see something like this in the terminal:
10331033

10341034
```sh
10351035
$ graph test -c

0 commit comments

Comments
 (0)