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
Is it really necessary to use isDone()/done()? #1830
Comments
That's it exactly! By the way, there's some discussion on improving the "lifecycle methods" in #1753. I'd like to add a function that checks that all the mocks have been fulfilled. |
In test suites that have zero live-outbound traffic, I personally don't find myself using the isDone/done in isolated tests. Instead I use a global |
Thank you guys for the responses. Both are helpful! |
As per docs, On the other hand, Hope this helps others |
I use nock a lot in my React testing and one thing I noticed is that there's no real convention in mock or best practices as to how you properly nock mock an API request. So, I need some help regarding this simple question - is using
scope.done()
ornock.isDone()
or.done()
really necessary? Is there a real benefit as to using it while in test aside from making sure that your mock requests get resolved mocked (and finished/"done") by nock? What am I not seeing that nock is doing behind the scenes?Thanks~
The text was updated successfully, but these errors were encountered: