Update unit-testing.md

This commit is contained in:
dr. mia von steinkirch, phd 2023-02-17 18:04:34 -08:00 committed by GitHub
parent 3800cd5e8a
commit e23b6d5172
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,13 @@
## basic Unit testing
## basic solidity unity test
<br>
Functions in a test file to make testing more structural:
### functions
<br>
functions in a test file to make testing more structural:
* `beforeEach()` - Runs before each test
* `beforeAll()` - Runs before all tests
@ -11,7 +16,7 @@ Functions in a test file to make testing more structural:
<br>
A generic unit testing file looks like:
a generic unit testing file looks like:
```
@ -58,6 +63,19 @@ contract testSuite {
}
```
Note that ine can input custom values for `msg.sender` & `msg.value` of transaction using NatSpec comments.
note that ine can input custom values for `msg.sender` & `msg.value` of transaction using NatSpec comments.
<br>
---
### resources
<br>
* [Solidity-Coverage](https://github.com/sc-forks/solidity-coverage)
* [Remix tests](https://github.com/ethereum/remix-project/tree/master/libs/remix-tests)
* [OpenZeppelin test helpers](https://github.com/OpenZeppelin/openzeppelin-test-helpers)
* [foundry forge tests](https://github.com/foundry-rs/foundry/tree/master/forge)
* [etheno](https://github.com/crytic/etheno)