5.5.0-patch2 • Published 8 years ago

unexpected-http-alexjeffburke v5.5.0-patch2

Weekly downloads
2
License
BSD-3-Clause
Repository
github
Last release
8 years ago

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).

NPM version Build Status Coverage Status Dependency Status

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/
        });
    });
});