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

Testing: use simpler jest.fn() mocks for api-fetch calls in unit tests #8298

Merged
merged 1 commit into from
Jul 31, 2018

Conversation

youknowriad
Copy link
Contributor

This Tiny PR, simplifies and unifies how we mock api-fetch calls by avoiding the global mock and just using jest.fn per test.

Testing instructions

  • Check that the unit tests are still passing properly.

@youknowriad youknowriad added the [Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests. label Jul 30, 2018
@youknowriad youknowriad self-assigned this Jul 30, 2018
@youknowriad youknowriad requested a review from gziolo July 30, 2018 14:47
Copy link
Member

@jorgefilipecosta jorgefilipecosta left a comment

Choose a reason for hiding this comment

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

The tests are passing, I did some grepping and it looks like all occurrences of @wordpress/api-fetch in tests were mocked.

Copy link
Member

@gziolo gziolo left a comment

Choose a reason for hiding this comment

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

Sweet 🥇

@gziolo gziolo added this to the 3.4 milestone Jul 31, 2018
@gziolo gziolo merged commit d903fe8 into master Jul 31, 2018
@gziolo gziolo deleted the update/api-fetch-mocks branch July 31, 2018 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Automated Testing Testing infrastructure changes impacting the execution of end-to-end (E2E) and/or unit tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants