unexpected-http
Unexpected plugin for testing HTTP servers. Uses same syntax as unexpected-express whenever possible.
Works with node.js and in browsers via browserify (see example).
var expect = require('unexpected').clone().installPlugin(require('unexpected-http'));
describe('google.com', function () {
it('should redirect to a country-specific version', function (done) {
expect('GET http://google.com/', 'to yield response', {
statusCode: 302,
headers: {
Location: /www\.google\.\w+/
},
body: /The document has moved/
}, done);
});
});