Recall & Review
beginner
What is Hardhat in blockchain development?
Hardhat is a development environment to compile, deploy, test, and debug Ethereum software. It helps developers write smart contracts and test them locally.
Click to reveal answer
beginner
Which command initializes a new Hardhat project?
The command
npx hardhat starts the Hardhat project setup wizard, which helps create the project structure and configuration files.Click to reveal answer
beginner
What file contains the configuration for Hardhat testing?
The
hardhat.config.js file contains settings for the Hardhat environment, including network configurations and plugins for testing.Click to reveal answer
intermediate
How do you write a simple test in Hardhat using Mocha and Chai?
You write tests inside the
test/ folder using JavaScript. Use describe blocks to group tests and it blocks for individual tests. Use expect from Chai to check results.Click to reveal answer
beginner
What command runs the tests in a Hardhat project?
Use
npx hardhat test to run all tests in the test/ directory. This runs your smart contract tests locally.Click to reveal answer
Which folder typically contains Hardhat test files?
✗ Incorrect
Hardhat test files are usually placed in the
test/ folder.What library is commonly used with Hardhat for assertions in tests?
✗ Incorrect
Chai is a popular assertion library used with Hardhat tests.
Which command initializes a Hardhat project?
✗ Incorrect
Running
npx hardhat starts the project setup wizard.What does
npx hardhat test do?✗ Incorrect
It runs all the tests written in the
test/ directory.Which file configures Hardhat settings?
✗ Incorrect
The
hardhat.config.js file holds Hardhat configuration.Explain the steps to set up a basic Hardhat testing environment from scratch.
Think about commands, folder structure, and test writing.
You got /4 concepts.
Describe how you write a simple test for a smart contract function using Hardhat and Chai.
Focus on test structure and assertion.
You got /4 concepts.