From eaa39fc6311acc018dacc276a0e070bc70165712 Mon Sep 17 00:00:00 2001 From: "Shiv Bhonde | shivbhonde.eth" Date: Tue, 26 Nov 2024 22:55:39 +0530 Subject: [PATCH] Copy solidity test files conditionally (#158) --- .../foundry/packages/foundry/test/YourContract.t.sol | 6 +++--- .../hardhat/packages/hardhat/test/YourContract.ts | 0 .../foundry/packages/foundry/test/.gitkeep | 2 ++ .../hardhat/packages/hardhat/test/.gitkeep | 2 ++ 4 files changed, 7 insertions(+), 3 deletions(-) rename templates/{solidity-frameworks => example-contracts}/foundry/packages/foundry/test/YourContract.t.sol (81%) rename templates/{solidity-frameworks => example-contracts}/hardhat/packages/hardhat/test/YourContract.ts (100%) create mode 100644 templates/solidity-frameworks/foundry/packages/foundry/test/.gitkeep create mode 100644 templates/solidity-frameworks/hardhat/packages/hardhat/test/.gitkeep diff --git a/templates/solidity-frameworks/foundry/packages/foundry/test/YourContract.t.sol b/templates/example-contracts/foundry/packages/foundry/test/YourContract.t.sol similarity index 81% rename from templates/solidity-frameworks/foundry/packages/foundry/test/YourContract.t.sol rename to templates/example-contracts/foundry/packages/foundry/test/YourContract.t.sol index 5104250f4..68e6c99c8 100644 --- a/templates/solidity-frameworks/foundry/packages/foundry/test/YourContract.t.sol +++ b/templates/example-contracts/foundry/packages/foundry/test/YourContract.t.sol @@ -2,10 +2,10 @@ pragma solidity ^0.8.13; import "forge-std/Test.sol"; -// import "../contracts/YourContract.sol"; +import "../contracts/YourContract.sol"; contract YourContractTest is Test { -/* YourContract public yourContract; + YourContract public yourContract; function setUp() public { yourContract = new YourContract(vm.addr(1)); @@ -16,5 +16,5 @@ contract YourContractTest is Test { keccak256(bytes(yourContract.greeting())) == keccak256("Building Unstoppable Apps!!!") ); - } */ + } } diff --git a/templates/solidity-frameworks/hardhat/packages/hardhat/test/YourContract.ts b/templates/example-contracts/hardhat/packages/hardhat/test/YourContract.ts similarity index 100% rename from templates/solidity-frameworks/hardhat/packages/hardhat/test/YourContract.ts rename to templates/example-contracts/hardhat/packages/hardhat/test/YourContract.ts diff --git a/templates/solidity-frameworks/foundry/packages/foundry/test/.gitkeep b/templates/solidity-frameworks/foundry/packages/foundry/test/.gitkeep new file mode 100644 index 000000000..073c054e1 --- /dev/null +++ b/templates/solidity-frameworks/foundry/packages/foundry/test/.gitkeep @@ -0,0 +1,2 @@ +# Write tests for your smart contract in this directory +# Example: YourContract.t.sol diff --git a/templates/solidity-frameworks/hardhat/packages/hardhat/test/.gitkeep b/templates/solidity-frameworks/hardhat/packages/hardhat/test/.gitkeep new file mode 100644 index 000000000..ea9d6dc32 --- /dev/null +++ b/templates/solidity-frameworks/hardhat/packages/hardhat/test/.gitkeep @@ -0,0 +1,2 @@ +# Write tests for your smart contract in this directory +# Example: YourContract.ts