{"id":17981138,"url":"https://github.com/ahmedali8/hardhat-test-suite-generator","last_synced_at":"2026-03-11T05:05:24.517Z","repository":{"id":61969351,"uuid":"541417461","full_name":"ahmedali8/hardhat-test-suite-generator","owner":"ahmedali8","description":"Hardhat plugin for generating a test suite structure for smart contracts","archived":false,"fork":false,"pushed_at":"2023-07-07T11:52:43.000Z","size":2502,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-05T19:31:09.382Z","etag":null,"topics":["fixtures","hardhat-plugin","npm-package","test-suite","typechain"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahmedali8.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-26T05:11:39.000Z","updated_at":"2023-05-10T09:16:43.000Z","dependencies_parsed_at":"2024-10-29T18:57:46.840Z","dependency_job_id":null,"html_url":"https://github.com/ahmedali8/hardhat-test-suite-generator","commit_stats":{"total_commits":30,"total_committers":1,"mean_commits":30.0,"dds":0.0,"last_synced_commit":"8cdac46d17c33c247a295456bf39c12756766b9a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":"NomicFoundation/hardhat-ts-plugin-boilerplate","purl":"pkg:github/ahmedali8/hardhat-test-suite-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedali8%2Fhardhat-test-suite-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedali8%2Fhardhat-test-suite-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedali8%2Fhardhat-test-suite-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedali8%2Fhardhat-test-suite-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahmedali8","download_url":"https://codeload.github.com/ahmedali8/hardhat-test-suite-generator/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahmedali8%2Fhardhat-test-suite-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30372127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"online","status_checked_at":"2026-03-11T02:00:07.027Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fixtures","hardhat-plugin","npm-package","test-suite","typechain"],"created_at":"2024-10-29T18:07:58.052Z","updated_at":"2026-03-11T05:05:19.509Z","avatar_url":"https://github.com/ahmedali8.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hardhat Test Suite Generator [![GitHub Actions][gha-badge]][gha] [![Coverage Status][coveralls-badge]][coveralls] [![Styled with Prettier][prettier-badge]][prettier] [![License: MIT][license-badge]][license]\n\n[gha]: https://github.com/ahmedali8/hardhat-test-suite-generator/actions\n[gha-badge]:\n  https://github.com/ahmedali8/hardhat-test-suite-generator/actions/workflows/ci.yml/badge.svg\n[coveralls]: https://coveralls.io/github/ahmedali8/hardhat-test-suite-generator\n[coveralls-badge]:\n  https://coveralls.io/repos/github/ahmedali8/hardhat-test-suite-generator/badge.svg?branch=main\n[prettier]: https://prettier.io\n[prettier-badge]: https://img.shields.io/badge/Code_Style-Prettier-ff69b4.svg\n[license]: https://opensource.org/licenses/MIT\n[license-badge]: https://img.shields.io/badge/License-MIT-blue.svg\n\nHardhat plugin for generating a test suite structure for smart contracts\n\n## Description\n\nThis plugin builds on top the\n[TypeChain plugin](https://github.com/ethereum-ts/TypeChain/tree/master/packages/hardhat),\n[Hardhat toolbox](https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-toolbox),\n[Hardhat network helpers](https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-network-helpers)\nand\n[Hardhat chai matchers](https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-chai-matchers).\nMore specifically, it creates a separate file for each function of the contract that is not in the\nexclude contract list generating a directory structure for each contract and a shared folder for\ntypes.\n\n## Installation\n\nFirst, install the plugin and its peer dependencies.\n\nif you are using `Yarn`, run:\n\n```sh\nyarn add --dev hardhat-test-suite-generator @nomicfoundation/hardhat-toolbox\n```\n\nor if you are using `npm`, run:\n\n```sh\nnpm install --save-dev hardhat-test-suite-generator @nomicfoundation/hardhat-toolbox\n```\n\nSecond, import the plugin in your `hardhat.config.ts`:\n\n```typescript\nimport \"@nomicfoundation/hardhat-toolbox\";\nimport \"hardhat-test-suite-generator\";\n```\n\n## Required plugins\n\n- [@typechain/hardhat](https://github.com/ethereum-ts/TypeChain/tree/master/packages/hardhat)\n- [@nomicfoundation/hardhat-toolbox](https://github.com/NomicFoundation/hardhat/tree/main/packages/hardhat-toolbox)\n\n## Tasks\n\nThis plugin adds the _generate-test-suite_ task to Hardhat:\n\n```text\nGenerates a test suite structure for smart contracts\n```\n\n## Environment Extensions\n\nThis plugin does not extend the Hardhat Runtime Environment.\n\n## Configuration\n\nThis plugin extends the `HardhatUserConfig` object with an optional `testSuiteGenerator` object.\nThis object contains two fields, `excludeContracts` and `outDirName`. `excludeContracts` is an array\nof strings that represent the names of the smart contracts in your project to exclude. The plugin\nuses this array and eliminates these contracts from the test suite structure. `outDirName` is a\nstring name e.g. \"test\".\n\nAn example for how to set it:\n\n```javascript\nmodule.exports = {\n  testSuiteGenerator: {\n    // What contracts to exclude from the test suite\n    // Defaults to []\n    excludeContracts: [\"MyToken\", \"ERC20\"],\n    // Out directory name for the test suite\n    // Must not contain \"/\"\n    // Defaults to \"test\"\n    outDirName: \"test\",\n  },\n};\n```\n\n## Usage\n\nIf you are using `Yarn`, run this:\n\n```sh\nyarn hardhat generate-test-suite\n```\n\nor if you are using `npm`, run this:\n\n```sh\nnpx hardhat generate-test-suite\n```\n\nAnd go look what you got in the `test` directory. For excluding any contract or renaming the test\nfolder name refer to the [configuration](./README.md#configuration) section above.\n\n## FAQ\n\n### I get an error when using Yarn\n\nmake sure these packages are present in your `dependencies` or `devDependencies`:\n\n```sh\nyarn add --dev \\\n  @nomicfoundation/hardhat-chai-matchers \\\n  @nomicfoundation/hardhat-ethers \\\n  @nomicfoundation/hardhat-network-helpers \\\n  @nomicfoundation/hardhat-toolbox \\\n  @nomicfoundation/hardhat-verify \\\n  @typechain/ethers-v6 \\\n  @typechain/hardhat \\\n  @types/chai \\\n  @types/mocha \\\n  chai \\\n  hardhat-gas-reporter \\\n  solidity-coverage \\\n  ts-node \\\n  typescript\n```\n\n## Tips\n\n- See how the plugin is used in\n  [hardhat-ts-template](https://github.com/ahmedali8/hardhat-ts-template), and\n  [foundry-hardhat-template](https://github.com/ahmedali8/foundry-hardhat-template).\n\n## License\n\n[MIT](./LICENSE.md) © Ahmed Ali\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedali8%2Fhardhat-test-suite-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahmedali8%2Fhardhat-test-suite-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahmedali8%2Fhardhat-test-suite-generator/lists"}