comingAlive / hardhat-jest-example

Hardhat TypeScript Jest Dev Starter Kit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hardhat TypeScript Jest Dev Starter Kit

Mocha and Chai instead of Jest: https://github.com/rhlsthrm/typescript-solidity-dev-starter-kit

Consists of:

  1. Hardhat - Ethereum development environment.
  2. Ethers - Ethereum interactions and utilities.
  3. TypeChain - TypeScript typings generator.
  4. Jest - testing framework.
  5. Waffle - testing matchers.

How to use

Clone repo and install dependencies:

git clone https://github.com/comingAlive/hardhat-jest-example.git
cd hardhat-jest-example

npm install
# or
yarn

Available Functionality

Build Contracts and Generate Typechain Typings

yarn compile

Run Contract Tests.

jest

Start a local node.

hardhat node

Run Contract Test on the local network.

yarn test -- --network localhost

Deploy to Ethereum

Create/modify network config in hardhat.config.ts and add API key and private key, then run:

hardhat run --network rinkeby scripts/deploy.ts

Verify on Etherscan

Add Etherscan API key to hardhat.config.ts, then run:

hardhat verify-contract --contract-name Counter --address <DEPLOYED ADDRESS>

About

Hardhat TypeScript Jest Dev Starter Kit


Languages

Language:TypeScript 78.5%Language:Solidity 17.0%Language:Shell 2.7%Language:JavaScript 1.8%