Nock: Two calls of same method in test failing

Created on 22 Jan 2017  路  3Comments  路  Source: nock/nock

I am trying to test a post() twice in the same test file. It passes on the first call but fails on the second call with Nock: No match for request POST. Both tests pass individually as well so I am thinking its something with multiple calls to a nock method under the same test.

Most helpful comment

This is the expected behavior.
See: read-this---about-interceptors

To repeat a response, either specify the number of times:
https://github.com/pgte/nock#repeat-response-n-times

or allow infinite repeated responses:
https://github.com/pgte/nock#persist

All 3 comments

This is the expected behavior.
See: read-this---about-interceptors

To repeat a response, either specify the number of times:
https://github.com/pgte/nock#repeat-response-n-times

or allow infinite repeated responses:
https://github.com/pgte/nock#persist

This seems to still be an issue with recorded nock.back fixtures, since only 1 copy of each request is saved. How do I fix that?

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue and add a reference to this one if it鈥檚 related. Thank you!

Was this page helpful?
0 / 5 - 0 ratings