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

refactor(test): Mocha DSL for request overrider #1923

Merged
merged 1 commit into from Feb 19, 2020

Conversation

mastermatt
Copy link
Member

@mastermatt mastermatt commented Feb 19, 2020

CR without whitespace still recommended.


// https://github.com/nock/nock/issues/1836
test('when http.get and http.request have been overridden before nock overrides them, http.get calls through to the expected method', async t => {
// TODO Investigate why this is needed when it's also in the `afterEach()`
Copy link
Member Author

Choose a reason for hiding this comment

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

This todo and end hook is what prompted the investigation into retorting Sinon and led to the update in setup.js.

@@ -18,6 +18,8 @@ afterEach(function() {
nock.restore()
nock.cleanAll()
nock.enableNetConnect()
nock.activate()
// It's important that Sinon is restored before Nock is reactivated for tests that stub/spy built-in methods,
// otherwise Sinon loses track of the stubs and can't restore them.
Copy link
Member

Choose a reason for hiding this comment

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

👍

Thanks for tracking down the issue!

@mastermatt mastermatt merged commit 9dcd747 into nock:master Feb 19, 2020
@mastermatt mastermatt deleted the 1305/request-overrider/mocha branch February 19, 2020 21:41
@github-actions
Copy link

github-actions bot commented Mar 1, 2020

🎉 This PR is included in version 12.0.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants