ys-vcr

0.4.2 • Public • Published

VCR Build Status

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
  }
}

Readme

Keywords

Package Sidebar

Install

npm i ys-vcr

Weekly Downloads

4

Version

0.4.2

License

MIT

Last publish

Collaborators

  • yann_ck