Is there a VCR testing system for node.js?
Node.js: Testing with VCR
5.5k Views Asked by donald At
5
There are 5 best solutions below
0

I use node-replay:
Node Replay
When API testing slows you down: record and replay HTTP responses like a boss
Things that will ruin your day when tests make HTTP requests to other services:
- That other service has the uptime of Twitter's API
- Network late............ ncy
- Being-rate limited and having to wait an hour for the next test run
- Same request returns different result each time
- Everyone else on the network is deep in BitTorrent terittory
Things node-replay can do to make these problems go away:
- Record API response once, replay as often as necessary
- Stub HTTP requests (TBD)
- Replay different responses to same request (great for testing error handling)
- Not suck
0

Update (2012-02-08): VCR.js was recently released.
Not that I know of. It sounds like @derwildemomo is working on one, though.
If you find one, let me know and I'll be happy to add a link to it from VCR's readme.
0

Update(2017-03-29):
VCR.js https://github.com/elcuervo/vcr.js
Nock https://github.com/node-nock/nock#recording
Guzzle a similar tool, but it's bundled with the PHP library: https://github.com/guzzle/guzzle/blob/master/tests/Guzzle/Tests/Http/server.js