Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

should-http

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

should-http

Http requests, response assertions for should.js

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
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

Package last updated on 29 May 2014

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc