0.1.1 • Published 7 years ago

should-http v0.1.1

Weekly downloads
5,474
License
MIT
Repository
github
Last release
7 years ago

should.js http assertions

Build Status

This module can be usefull for asserting on node standard http modele request and response.

Install

npm install should-http --save-dev
require('should-http');

That row patch your should instance adding assertions. With mocha you can use it via -r switch.

.status(code)

Asserts that .statusCode is code:

res.should.have.status(200);

.header(field, value)

Asserts that a .headers object with field and optional value are present:

res.should.have.header('content-length');
res.should.have.header('Content-Length', '123');

.json

Assert that Content-Type is "application/json; charset=utf-8"

res.should.be.json

.html

Assert that Content-Type is "text/html; charset=utf-8"

res.should.be.html
0.1.1

7 years ago

0.1.0

7 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

10 years ago

0.0.1

10 years ago