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

Prevent console.warn from getting logged during testing #1378

Merged
merged 4 commits into from
Feb 22, 2022

Conversation

joebuono
Copy link
Contributor

Description of changes

Updated Tabs tests to prevent console.warn from getting logged during testing.

I tried using the const originalWarn = console.warn trick, but I got the following error:

   Matcher error: received value must be a mock or spy function

    Received has type:  function
    Received has value: [Function warn]

I found a way to use .mockImplementation(), which worked: jest.fn() value must be a mock function or spy

Issue #, if available

Description of how you validated changes

Ran yarn test locally.

Checklist

  • PR description included
  • yarn test passes
  • Tests are updated

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@joebuono joebuono requested a review from reesscot February 21, 2022 18:18
@joebuono joebuono temporarily deployed to ci February 21, 2022 18:30 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 18:30 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 18:30 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 18:30 Inactive
@changeset-bot
Copy link

changeset-bot bot commented Feb 21, 2022

⚠️ No Changeset found

Latest commit: b889dc3

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

@joebuono joebuono temporarily deployed to ci February 21, 2022 22:26 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 22:26 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 22:26 Inactive
@joebuono joebuono temporarily deployed to ci February 21, 2022 22:26 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 17:40 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 17:40 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 17:40 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 17:40 Inactive
Copy link
Contributor

@zchenwei zchenwei left a comment

Choose a reason for hiding this comment

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

LGTM :shipit:

@joebuono joebuono temporarily deployed to ci February 22, 2022 18:44 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 18:44 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 18:44 Inactive
@joebuono joebuono temporarily deployed to ci February 22, 2022 18:44 Inactive
@joebuono joebuono merged commit 040daa2 into main Feb 22, 2022
@joebuono joebuono deleted the console-warn-tabs branch February 22, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants