Example Contracts

You can explore and run tests on all the example contracts provided in a single Hardhat repository for better understanding. The repository is available at: Inco Example Contracts.

Specific Test Cases for a Specific Contract

To execute a specific test case for a particular contract, you can use the --grep option with the npx hardhat test command. This allows you to run tests that match a specific description.

Syntax:

npx hardhat test --grep "<test case description>" --network <network_name>

Example:

To run the test case "should allow a user to place a bid and update the highest bid" on the rivest network:

npx hardhat test --grep "should allow a user to place a bid and update the highest bid" --network rivest

This command will only execute the test cases that match the provided description under the specified network.

Last updated