Is there a VCR testing system for node.js?
Asked
Active
Viewed 5,436 times
5 Answers
11
Node nock, which is part of the flatiron library/framework has this feature, look here

Marcos Oliveira
- 1,697
- 1
- 14
- 13
-
1Nock is the real node-equivalent of VCR; VCR.js is specific only to browser(like) environments, since it records `XMLHttpRequest` events. Thanks! – namuol Nov 12 '13 at 01:59
5
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

Community
- 1
- 1

Michelle Tilley
- 157,729
- 40
- 374
- 311
4
Update(2017-03-29):
VCR.js https://github.com/elcuervo/vcr.js
Nock https://github.com/node-nock/nock#recording

Spyros
- 227
- 2
- 12
4
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.

Myron Marston
- 21,452
- 5
- 64
- 63
0
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

Michael Dowling
- 5,098
- 4
- 32
- 28