Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 795 Bytes

README.md

File metadata and controls

37 lines (24 loc) · 795 Bytes

Hardhat Testing Demo

This project demonstrates writing Hardhat unit tests for a basic smart contract in Solidity.

Project Setup

Install nvm if you don't have it already:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

Install and switch to node version specified in .nvmrc file:

nvm install

Install all needed dependencies:

npm install

Running the tests

Run the following to have the tests run once:

npx hardhat test

Run the following to have the tests in "watch" mode, where any changes to the contracts and test files will trigger compilation of the contracts (if necessary) and another run of the tests:

npm run test