Hardhat + Viem Project Structure
This document provides an overview of the project structure for a Chukti project using Hardhat and Viem. Understanding the layout and purpose of each directory and file will help you navigate and manage your project effectively.
Project Structure
After initializing your Hardhat + Viem project, you will have the following structure:
my-chukti-project/
├── contracts/
│ └── Counter.sol
├── features/
│ └── counter.feature
├── support/
│ └── chukti/
│ └── steps.ts
├── test-reports/
│ └── test-report.html
├── .gitignore
├── chukti.config.json
├── cucumber.json
├── hardhat.config.ts
├── package.json
├── tsconfig.json
└── README.md
Directory and File Descriptions
contracts/
Counter.sol
: This directory contains your Solidity contracts. TheCounter.sol
file is a sample contract provided to get you started. You can add more contracts as needed.
features/
counter.feature
: This directory contains your Cucumber feature files. Thecounter.feature
file defines test scenarios for theCounter
contract using Gherkin syntax. You can create additional feature files to test other contracts or scenarios.
support/
steps.ts
: This file maps the steps in thecounter.feature
file to the actual code that performs the actions. You can add more step definition files as needed.
test-reports/
test-report.html
: This directory will contain the test reports generated after running your tests. Thetest-report.html
file is an example of a test report. You can configure the format and location of the reports in your project settings.
.gitignore
- This file specifies which files and directories should be ignored by Git. It includes common directories like
node_modules
,artifacts
, andcoverage
.
chukti.config.json
- This is the configuration file for Chukti. It specifies the project type and other settings. For example:
json
{
"projectType": "hardhat-viem"
}
cucumber.json
- This file configures Cucumber for your project. It specifies the paths to your feature files and step definitions, as well as the format and location of the test reports.
hardhat.config.ts
- This is the configuration file for Hardhat. It specifies the Solidity version and other settings for your Hardhat project.