Add a basic tool to run End-to-End tests written in Solidity.
Every contract in the designated testing directory will be treated as a test. The setUp, test, and testFail keywords are supported and have the same functionality as they do in foundry's forge.
contract Test {
// setUp: An function invoked before each test case is run.
// It is not optional but it should be.
function setUp() external {
return;
}
// test: Functions prefixed with test are run as a test case.
// This will pass.
function testSuccess() external {
return;
}
// testFail: The inverse of the test prefix - if the function does not revert, the test fails.
// This will pass.
function testFailure() external {
revert();
}
}
Add a basic tool to run End-to-End tests written in Solidity.
Every contract in the designated testing directory will be treated as a test. The
setUp
,test
, andtestFail
keywords are supported and have the same functionality as they do in foundry's forge.