-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/unified-test-workflow' into feat…
…/solidity-test-configuration
- Loading branch information
Showing
48 changed files
with
416 additions
and
184 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import "forge-std/Test.sol"; | ||
|
||
contract TestContract is Test { | ||
ErrorsTest test; | ||
|
||
function setUp() public { | ||
test = new ErrorsTest(); | ||
} | ||
|
||
function testExpectArithmetic() public { | ||
vm.expectRevert(stdError.arithmeticError); | ||
test.arithmeticError(10); | ||
} | ||
} | ||
|
||
contract ErrorsTest { | ||
function arithmeticError(uint256 a) public { | ||
uint256 a = a - 100; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,12 +51,6 @@ const exampleTaskOverride = task("example2") | |
}) | ||
.build(); | ||
|
||
const testSolidityTask = task(["test", "solidity"], "Runs Solidity tests") | ||
.setAction(async () => { | ||
console.log("Running Solidity tests"); | ||
}) | ||
.build(); | ||
|
||
const greeting = task("hello", "Prints a greeting") | ||
.addOption({ | ||
name: "greeting", | ||
|
@@ -114,7 +108,6 @@ const pluginExample = { | |
const config: HardhatUserConfig = { | ||
tasks: [ | ||
exampleTaskOverride, | ||
testSolidityTask, | ||
exampleEmptyTask, | ||
exampleEmptySubtask, | ||
greeting, | ||
|
@@ -125,8 +118,7 @@ const config: HardhatUserConfig = { | |
pluginExample, | ||
hardhatEthersPlugin, | ||
HardhatKeystore, | ||
// HardhatMochaTestRunner, | ||
// if testing node plugin, use the following line instead | ||
HardhatMochaTestRunner, | ||
hardhatNetworkHelpersPlugin, | ||
HardhatNodeTestRunner, | ||
HardhatViem, | ||
|
@@ -165,7 +157,11 @@ const config: HardhatUserConfig = { | |
}, | ||
}, | ||
dependenciesToCompile: ["@openzeppelin/contracts/token/ERC20/ERC20.sol"], | ||
remappings: ["remapped/=npm/@openzeppelin/[email protected]/access/"], | ||
remappings: [ | ||
"remapped/=npm/@openzeppelin/[email protected]/access/", | ||
// This is necessary because most people import forge-std/Test.sol, and not forge-std/src/Test.sol | ||
"forge-std/=npm/[email protected]/src/", | ||
], | ||
}, | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 71 additions & 5 deletions
76
v-next/hardhat/src/internal/builtin-plugins/artifacts/hook-handlers/hre.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.