Skip to content

fix: restore removed export paths for backward compat with older test runners#8029

Merged
schaable merged 2 commits intomainfrom
revert-test-runner-helpers
Mar 5, 2026
Merged

fix: restore removed export paths for backward compat with older test runners#8029
schaable merged 2 commits intomainfrom
revert-test-runner-helpers

Conversation

@schaable
Copy link
Copy Markdown
Member

@schaable schaable commented Mar 4, 2026

PR #8001 removed the hardhat/internal/coverage and hardhat/internal/gas-analytics export paths, breaking users who upgrade hardhat but keep older versions of hardhat-mocha or hardhat-node-test-runner. This restores those exports as thin wrappers around shared logic extracted from the new hook handlers.

@schaable schaable requested a review from Copilot March 4, 2026 14:46
@schaable schaable self-assigned this Mar 4, 2026
@schaable schaable added no docs needed This PR doesn't require links to documentation no peer bump needed labels Mar 4, 2026
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 1eedc57

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Restores legacy internal export paths (hardhat/internal/coverage and hardhat/internal/gas-analytics) to maintain backward compatibility with older Hardhat test runner plugins, by reintroducing wrapper exports around the new hook handler logic.

Changes:

  • Extracted gas-analytics test hook logic into reusable exported functions.
  • Added backward-compatible helper wrappers and an internal export entrypoint for gas-analytics.
  • Re-added ./internal/coverage and ./internal/gas-analytics export paths in package.json.

Reviewed changes

Copilot reviewed 4 out of 7 changed files in this pull request and generated 1 comment.

File Description
v-next/hardhat/src/internal/builtin-plugins/gas-analytics/hook-handlers/test.ts Refactors hook logic into exported helper functions reused by legacy wrappers.
v-next/hardhat/src/internal/builtin-plugins/gas-analytics/helpers.ts Adds backward-compat wrapper helpers that resolve the HRE and delegate to extracted logic.
v-next/hardhat/src/internal/builtin-plugins/gas-analytics/exports.ts Provides a stable internal export surface for legacy imports.
v-next/hardhat/package.json Restores internal export paths to point at the new wrapper entrypoints.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@schaable
Copy link
Copy Markdown
Member Author

schaable commented Mar 4, 2026

Not sure this needs a changeset, @alcuadrado, since it's going out in the same release as the original PR. Wdyt?

@schaable schaable requested a review from alcuadrado March 4, 2026 15:09
@alcuadrado alcuadrado added the no changeset needed This PR doesn't require a changeset label Mar 4, 2026
@alcuadrado
Copy link
Copy Markdown
Member

Not needed

@schaable schaable added this pull request to the merge queue Mar 5, 2026
Merged via the queue into main with commit d2b864c Mar 5, 2026
418 of 420 checks passed
@schaable schaable deleted the revert-test-runner-helpers branch March 5, 2026 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no changeset needed This PR doesn't require a changeset no docs needed This PR doesn't require links to documentation no peer bump needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants