Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: disable console for init tests #5807

Merged
merged 1 commit into from
Oct 7, 2024
Merged

Conversation

galargh
Copy link
Member

@galargh galargh commented Oct 7, 2024

  • Because this PR includes a bug fix, relevant tests have been included.
  • Because this PR includes a new feature, the change was previously discussed on an Issue or with someone from the team.
  • I didn't do anything of this.

As explored in #5804, I have found that testing function that use console.log (i.e. write to stdout) can lead to Unable to deserialize cloned data due to invalid or unsupported version. errors.

In this PR, I introduce a helper function, which disables console.log/console.warn/console.dir (the console function which interact with either stdout or stderr directly). I also described how we could expand the helper in the future if needed.

An alternative I considered was overwriting the process.stdout and process.stderr streams directly, however I found that this can interfere with the reporter's output.

Copy link

vercel bot commented Oct 7, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
hardhat ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 7, 2024 9:39am

Copy link

changeset-bot bot commented Oct 7, 2024

⚠️ No Changeset found

Latest commit: 48c1a83

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.

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

@github-actions github-actions bot added the status:ready This issue is ready to be worked on label Oct 7, 2024
Copy link
Member

@schaable schaable left a comment

Choose a reason for hiding this comment

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

LGTM

@galargh galargh added this pull request to the merge queue Oct 7, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Oct 7, 2024
@galargh galargh added this pull request to the merge queue Oct 7, 2024
Merged via the queue into v-next with commit 86aa02f Oct 7, 2024
57 checks passed
@galargh galargh deleted the fix/deflake-init-tests branch October 7, 2024 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants