nock playback
Small helper for nock library to record definitions and play it back automatically
Install
npm install nock-playback
Usage
playback(fixtureName)
only call this method inside a test suite with a name and you're done. The library will record the nock definitions first time and save it in test/fixtures
directory. Next time, it'll load the definitions if found.
var request = ;var playback = ; ;
Options
playback.defaults.baseDir
: base directory to save definitions. default: /test/fixtures
playback.defaults.beforeCallback
: suite setup callback. default before
playback.defaults.afterCallback
: suite cleanup callback. default after