- Compile the contract
npx hardhat compile- Run a local blockchain network
npx hardhat node
npx hardhat node --fork https://mainnet.infura.io/v3/edb3ab1be8ee46eca1b5ee5e72ea139a --fork-block-number 18484706- Run test on local network
npx hardhat test --network local- Run test on other network
Set the network configuration in hardhat.config.js file first. Then run the following command.
npx hardhat test --network networkName