From the course: Building Web3 Decentralized Apps in Ethereum
Unlock the full course today
Join today to access over 24,900 courses taught by industry experts.
Testing with Hardhat and Waffle
From the course: Building Web3 Decentralized Apps in Ethereum
Testing with Hardhat and Waffle
- [Instructor] It cannot be overstated how critical it is to test our smart contracts. Because these contracts are responsible for sending tokens and handling financial transactions, we have to be absolutely sure that they're bug free. Additionally, deploying to the blockchain is a one-time thing. You don't get to update it. It's going to stay in that address forever, in the blockchain. So it's worth taking the extra time to make sure that we're prepared when we deploy our smart contracts. We're going to do testing again with Hardhat. Now, Hardhat has a couple of ways you can test. If you're using Ethers.js, you can use Ethers.js and Waffle, which is the testing environment. If you're using web3.js, you can use web3.js and Truffle. Now, regardless of which one you're using, behind the scenes, it's going to be using Mocha, which is, if you ever done testing on Node, you're probably familiar with it and Chi. Now Cha is what…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.