book
book copied to clipboard
Update testing functions examples with best practices
Hello forgers,
I spotted an inconsistency in the documentation. The Forge Guide part of the book is not up to date with the testing best practices described in the Tutorials chapter.
More specifically, the provided test functions examples do not comply with the following pattern, also outlined here:
-
test_Descriptionfor standard tests. -
testFuzz_Descriptionfor fuzz tests. -
test_Revert[If|When]_Conditionfor tests expecting a revert. -
testFork_Descriptionfor tests that fork from a network. -
testForkFuzz_Revert[If|When]_Conditionfor a fuzz test that forks and expects a revert.
This can lead newcomers on an unscrupulous path of writing unclear tests and thus have bad coverage.
To fix this, we would need to update the solidity contracts from the projects folder.
I can open a PR for dis.
Closed by #843? cc @mattsse