https://github.com/nock/nock#recording
This is a cool feature:
Guessing what the HTTP calls are is a mess, especially if you are introducing nock on your already-coded tests.
For these cases where you want to mock an existing live system you can record and playback the HTTP calls like this:
nock.recorder.rec()
// Some HTTP calls happen and the nock code necessary to mock
// those calls will be outputted to console
Recording relies on intercepting real requests and responses and then persisting them for later use.
In order to stop recording you should call nock.restore()
and recording will stop.