You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In working on recent tests, I have noticed that nock is not entirely preventing connections to the local couch instance, which is still required to run many tests.
I would propose one of the following:
migrating to using pouchdb for testing. I have had good results using that to replace couch in other unit tests, as long as the views used are not too complex (ours aren't in this case).
firewalling nock by disabling connections using disableNetConnect() and fixing any tests that break (see below).
For the firewalling option, I tried using code like the following:
I am all for calling nock.disableNetConnect(); to prevent nock from calling out to a real endpoint. It is definitely best practice for unit tests to not rely on external endpoints.
I don't think it is worth changing all the tests to use pouchdb unless there are some other benefits that it provides over nock.
@the-t-in-rtf Can you paste in the output from the tests before you added that nock.disableNetConnect()? I want to make sure I can reproduce your issue. Thanks!
With a single line change to one test I can break all tests. I disabled networking connections in the signup tests, and the rest of the tests (signin, delete) stop working.
In working on recent tests, I have noticed that nock is not entirely preventing connections to the local couch instance, which is still required to run many tests.
I would propose one of the following:
disableNetConnect()
and fixing any tests that break (see below).For the firewalling option, I tried using code like the following:
In doing so, I discovered that nock appears to be shared across tests, which is hugely dangerous. I will file a separate bug on that.
The text was updated successfully, but these errors were encountered: