ys-vcr
v0.4.2
Published
Play cassettes instead of making http queries
Downloads
6
Readme
VCR
Use json based cassettes to playback http queries.
Usage
vcr = require('vcr')
...
vcr.playback()
vcr.play('jurassic_park.vhs')
vcr.stop()
vcr.playback()
This will block all connections with nock
vcr.play()
This will mock connections to a certain endpoint
vcr.stop()
This will reallow connections
VHS format
module.exports.cassettes = {
'imdb rating post': {
'host': 'https://api.imdb.com',
'path': '/',
'method': 'post',
'body': { 'jurassicPark': { 'rating': '💕'}},
'code': 200
}
}