Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Edited tagline, added example

  • Loading branch information...
commit e670fc66b2a1054f3bc794254481922dc22caecf 1 parent 485c73d
@assaf authored
View
2  README.md
@@ -1,7 +1,7 @@
# Node Replay
-### When API testing slows you down: mock, record and replay HTTP requests/responses like a boss
+### 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:
View
19 example/fixtures/www.iheartquotes.com/exact_estimate
@@ -0,0 +1,19 @@
+/api/v1/random
+
+200 HTTP/1.1
+server: nginx/0.7.67
+date: Fri, 02 Dec 2011 02:58:03 GMT
+content-type: text/plain
+connection: keep-alive
+etag: "a7131ebc1e81e43ea9ecf36fa2fdf610"
+x-ua-compatible: IE=Edge,chrome=1
+x-runtime: 0.158080
+cache-control: max-age=0, private, must-revalidate
+content-length: 234
+x-varnish: 2274830138
+age: 0
+via: 1.1 varnish
+
+Oxymoron 2. Exact estimate
+
+[codehappy] http://iheartquotes.com/fortune/show/38021
View
19 example/test.js
@@ -0,0 +1,19 @@
+assert = require("assert")
+http = require("http")
+replay = require("../lib/replay")
+
+http.get({ hostname: "www.iheartquotes.com", path: "/api/v1/random" }, function(response) {
+ response.body = "";
+ response.on("data", function(chunk) {
+ response.body = response.body + chunk;
+ })
+ response.on("end", function() {
+
+ // Now check the request we made to the I <3 Quotes API
+ assert.equal(response.statusCode, 200);
+ assert.equal(response.body, "Oxymoron 2. Exact estimate\n\n[codehappy] http://iheartquotes.com/fortune/show/38021\n");
+ console.log("Woot!");
+
+ })
+})
+
View
2  package.json
@@ -1,5 +1,5 @@
{ "name": "replay",
- "description": "When API testing slows you down: mock, record and replay HTTP requests/responses like a boss",
+ "description": "When API testing slows you down: record and replay HTTP responses like a boss",
"version": "1.0.0",
"author": "Assaf Arkin <assaf@labnotes.org> (http://labnotes.org/)",
"keywords": [ "test", "testing", "mock", "stub", "http", "replay", "vcr", "api" ],
Please sign in to comment.
Something went wrong with that request. Please try again.