unexpected-http-alexjeffburke
v5.5.0-patch2
Published
Unexpected plugin for testing http servers
Downloads
6
Maintainers
Readme
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 () {
return expect('GET http://google.com/', 'to yield response', {
statusCode: 302,
headers: {
Location: /www\.google\.\w+/
},
body: /The document has moved/
});
});
});