Repository navigation
Document Solidity test profiles - #297
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
🟢 Approval recommended
The changes are documentation-focused and coherent, with only a minor capitalization consistency nit identified.
Pull request overview
Adds end-to-end documentation for Solidity Test Profiles in Hardhat 3, including configuration shapes, profile selection, Foundry migration guidance, and cross-linking from existing testing/build-profile docs.
Changes:
- Introduces a new Testing guide for Test Profiles and links it across relevant guides and references.
- Updates the configuration reference to document
test.solidity.profilesand the non-inheritance model. - Extends inline configuration docs with profile-scoped directives and updates Foundry compatibility/migration guidance accordingly.
File summaries
| File | Description |
|---|---|
| STYLE.md | Adds “Test Profile” to the proper-noun capitalization list. |
| src/content/docs/docs/reference/foundry-compatibility.mdx | Adds links/explanation connecting Foundry profiles/annotations to Hardhat Test Profiles and inline configuration. |
| src/content/docs/docs/reference/configuration.mdx | Documents test.solidity.profiles, mutual exclusivity rules, naming constraints, and non-inheritance. |
| src/content/docs/docs/migrate-from-foundry/index.mdx | Adds migration steps for splitting Foundry profiles across build/test axes and converting forge-config: annotations. |
| src/content/docs/docs/guides/writing-contracts/build-profiles.mdx | Clarifies Build Profiles scope and links to Test Profiles. |
| src/content/docs/docs/guides/testing/using-solidity.mdx | Adds guidance for selecting a Test Profile via --test-profile and links to the new guide. |
| src/content/docs/docs/guides/testing/test-profiles.mdx | New guide explaining configuration, selection, non-inheritance, and relation to Build Profiles/inline config. |
| src/content/docs/docs/guides/testing/inline-configuration.mdx | Documents profile-scoped inline overrides and corrects Foundry compatibility semantics; fixes allowInternalExpectRevert example. |
| src/content/docs/docs/guides/testing/index.mdx | Adds link to the Test Profiles guide from the Testing overview. |
| src/content/docs/docs/guides/testing/gas-statistics.mdx | Adjusts sidebar order to accommodate the new guide. |
| src/content/docs/docs/guides/testing/gas-snapshots.mdx | Adjusts sidebar order to accommodate the new guide. |
| src/content/docs/docs/guides/testing/eip712-types.mdx | Adjusts sidebar order to accommodate the new guide. |
| src/content/docs/docs/guides/testing/code-coverage.mdx | Adjusts sidebar order to accommodate the new guide. |
Review details
- Files reviewed: 13/13 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Clarify that default.<key> annotations must drop the default. prefix for overrides intended for every Test Profile.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 1

Documents Solidity test profiles, which let you run your tests with different settings and select them with
--test-profile.test.solidity.profilesin the configuration referencedefaultfoundry.tomlprofile across the build and test axes, and dropping thedefault.prefix fromforge-config:annotationsAlso fixes an unrelated error in the
allowInternalExpectRevertexample, which usedthis.myInternalHelper(). That's an external call at a lower depth, soexpectRevertcatches it with or without the setting; only a direct internal call demonstrates it.Related hardhat PR: NomicFoundation/hardhat#8145
Related EDR PR: github.com/NomicFoundation/edr/pull/1715