npm

Need private packages and team management tools?Check out npm Orgs. »

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

Keywords

install

npm i ys-vcr

Downloadsweekly downloads

40

version

0.4.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability