Skip to content
Advertisement

Tag: nock

Repeating nock responses indefinitely

The mocking framework Nock.js removes responses after answering them. There is a feature to repeat a response n times, but is there something I can do if I want it to respond to a certain request with the same response every time it is called? Answer You can use nock(url).get(path).times(Infinity).

How to decode nock recorded response

How to ad-hoc decode/uncompress the output produced by the nock recorder so we can see the response as text? I guess we do not understand if the response is gzipped and/or encoded The object works find when we load it into nock, and our tests are behaving as we expect. To see what the API produced, we are having to

Advertisement