should-http
Http requests, response assertions for should.js
Last updated 3 years ago by btd .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install should-http 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.1.1                                ...           latest (3 years ago)

6 Versions

  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.4                                ...           5 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 25
Last Day 0
Last Week 18
Last Month 74
Dependencies (1)
Dev Dependencies (5)

Copyright 2014 - 2016 © taobao.org |