{"_id":"@albanv/nock-vcr-recorder","_rev":"3-8a44673f25d417002f9b7f976f70528d","name":"@albanv/nock-vcr-recorder","description":"A test framework agnostic vcr implementation that uses nock.","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.4":{"name":"@albanv/nock-vcr-recorder","version":"0.1.4","description":"A test framework agnostic vcr implementation that uses nock.","main":"lib/vcr.js","scripts":{"test":"rm -rf cassettes && node_modules/mocha/bin/mocha test/*-test.js "},"repository":{"type":"git","url":"git+https://github.com/poetic/nock-vcr-recorder.git"},"keywords":["mocha","nock","testing","fixtures","mocking"],"author":{"name":"Jake Craige","email":"jake@poeticsystems.com"},"license":"MIT","bugs":{"url":"https://github.com/poetic/nock-vcr-recorder/issues"},"homepage":"https://github.com/poetic/nock-vcr-recorder","dependencies":{"bluebird":"^3.4.0","lodash":"^4.13.1","mkdirp":"^0.5.0","nock":"^8.0.0"},"devDependencies":{"express":"^4.13.4","mocha":"^2.5.1","request":"^2.73.0"},"gitHead":"f561c6d5eff20305d56d0c0271c1565769a74eec","_id":"@albanv/nock-vcr-recorder@0.1.4","_shasum":"76879262c98db238610fc27240562158655345e2","_from":".","_npmVersion":"3.9.5","_nodeVersion":"6.2.2","_npmUser":{"name":"albanv","email":"me@alban.io"},"dist":{"shasum":"76879262c98db238610fc27240562158655345e2","tarball":"https://registry.npmjs.org/@albanv/nock-vcr-recorder/-/nock-vcr-recorder-0.1.4.tgz","integrity":"sha512-rNt5E/iMfqQGhG/q4dcWRUKV3lF8SGZ2xr0chUsPf4JZP0WzDkX6z6tZrBMP8PDFvJSjuxKtb34knA0u8uINRQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB175fpHTF400QCSRDCWJYDD5vkFrDvq2EUURoEVEJQkAiAbuMpjXWHaz34EOdjvrpAKSlU7mh0TLvXFp7S1PNi9dA=="}]},"maintainers":[{"name":"albanv","email":"me@alban.io"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/nock-vcr-recorder-0.1.4.tgz_1468855173881_0.3791165971197188"}}},"readme":"# Nock VCR Recorder [![Build Status](https://travis-ci.org/poetic/nock-vcr-recorder.svg?branch=master)](https://travis-ci.org/poetic/nock-vcr-recorder)\n\nA test framework agnostic vcr implementation that uses\n[nock](https://github.com/pgte/nock). Can be used in isolation or test specific\nlibraries can be written around it.\n\n## Install\n\n```bash\nnpm install --save-dev nock-vcr-recorder\n```\n\n## Usage\n\nUse `vcr.useCassette` and pass in a callback with the test to run. All http\nrequests will be recorded using nock and stored in a cassettes directory for\nplayback on later test runs. It expects the callback to return a promise for\nasyncronous actions and it returns a promise that resolves when it's finished.\n\nExample using mocha:\n\n```js\nvar RSVP    = require('rsvp');\nvar request = RSVP.denodeify(require('request'));\nvar assert  = require('assert');\nvar vcr     = require('nock-vcr-recorder');\n\ndescribe('standard test', function() {\n  it('caches request', function() {\n    return vcr.useCassette('normal test - works', function() {\n      return request('http://localhost:4000/users').then(function() {\n        assert(true, 'request works');\n      });\n    });\n  });\n});\n\n// Usage with test specific options\n//\n// This test will not record the request to localhost:4000 and it will not use\n// any saved fixtures\ndescribe('normal test', function() {\n  it('works', function(done) {\n    return vcr.useCassette('normal test - works', {\n      excludeScope: 'localhost:4000'\n      mode: 'all'\n    }, function() {\n      return request('http://localhost:4000/users').then(function() {\n        assert(true, 'request works');\n      });\n    });\n  });\n});\n```\n\n## Configuration\n\nDefaults:\n\n```js\n{\n  // Don't record any requests to this scope\n  // It can be an array or string\n  excludeScope: ['localhost', '127.0.0.1', '0.0.0.0'],\n\n  // Re-record and overwrite your current fixtures\n  // Possible values: 'all'\n  mode: undefined, \n\n  // Write recorded fixtures when the test fails. We don't do this by default\n  writeOnFailure: false\n}\n```\n\nTo overide these you can call `vcr.config` with an object to\noverride them for ALL tests.\n\nYou also are able to pass in test specific options as the second parameter to\n`vcr.useCassette()`. See the \"Usage\" section above for an example.\n\n\n## Authors ##\n\n* [Jake Craige](http://twitter.com/jakecraige)\n\n## Versioning\n\nThis library follows [Semantic Versioning](http://semver.org)\n\n## Want to help?\n\nPlease do! We are always looking to improve this library. If you have any ideas\nplease open an issue or a pull requests and we'll work on getting them in.\n\n## Legal\n\n[Poetic Systems](http://poeticsystems.com), Inc &copy; 2014\n\n[@poeticsystems](http://twitter.com/poeticsystems)\n\n[Licensed under the MIT license](http://www.opensource.org/licenses/mit-license.php)\n\n","maintainers":[{"name":"albanv","email":"me@alban.io"}],"time":{"modified":"2022-06-12T14:27:40.888Z","created":"2016-07-18T15:19:36.071Z","0.1.4":"2016-07-18T15:19:36.071Z"},"homepage":"https://github.com/poetic/nock-vcr-recorder","keywords":["mocha","nock","testing","fixtures","mocking"],"repository":{"type":"git","url":"git+https://github.com/poetic/nock-vcr-recorder.git"},"author":{"name":"Jake Craige","email":"jake@poeticsystems.com"},"bugs":{"url":"https://github.com/poetic/nock-vcr-recorder/issues"},"license":"MIT","readmeFilename":"README.md"}