Skip to main content
grasp.study
Back to course
Log in
Get started
Someone wanted to learn this too, so Grasp built them a personal learning path.
Create your own
Blockchain for Tokenized Money
ยท
Module 3
Smart Contract Testing with Hardhat
1
Anatomy of an ethers.js Test File
Describe the structure of a test file using ethers.js and a testing framework (Mocha/Chai).
2
Deploying Contracts for Testing
Write a setup routine to deploy a fresh contract instance before each test.
3
Testing Smart Contracts with Ethers.js
Write unit tests for a contract's functions, asserting expected outcomes using ethers.js.
4
Testing Reverts with `revertedWith`
Test for expected reverts on failed conditions using `revertedWith`.
5
Testing Event Emissions
Test for correct event emissions and validate their arguments.
6
Simulating Multi-User Transactions and Access Control
Simulate transactions from different accounts to test multi-user interactions and access control.
7
Debugging Solidity with Hardhat Console.log
Use `console.log` from within Solidity for debugging purposes in a Hardhat environment.
Previous module
Solidity Fundamentals
Next module
Advanced Solidity and Security Patterns