0Pricing
Blockchain Smart Contracts with Solidity · Lesson

Writing and Running Contract Tests

Write automated tests for your smart contracts so you can catch bugs before deploying to a live network.

Why Test Smart Contracts?

Deployed contract code is immutable and often holds real value. A bug can be unfixable and costly. Automated tests let you verify behavior repeatedly and safely before any deployment.

The Test Toolkit

Hardhat and Truffle integrate test runners. Hardhat commonly uses Mocha with the Chai assertion library and ethers.js to deploy and call contracts in tests.

All lessons in this course

  1. Setting Up Hardhat or Truffle
  2. Compiling and Deploying Contracts
  3. Interacting with Deployed Contracts
  4. Writing and Running Contract Tests
← Back to Blockchain Smart Contracts with Solidity