Socket
Socket
Sign inDemoInstall

should-http

Package Overview
Dependencies
7
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    should-http

Http requests, response assertions for should.js


Version published
Weekly downloads
3.5K
decreased by-10.12%
Maintainers
1
Install size
21.7 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 22 Mar 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc