Socket
Socket
Sign inDemoInstall

jasmine-node-http-status-code-matcher

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jasmine-node-http-status-code-matcher

HTTP status code matcher for jasmine (gives you the textual status as well as the provided number)


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

Setup

Install via npm:

npm install --save-dev jasmine-node-http-status-code-matcher

import in node:

var customMatchers = require('jasmine-node-http-status-code-matcher');

tell jasmine to use the matchers:

jasmine.addMatchers(customMatchers);

Usage

Expect a status code to be a given status code

// res.statusCode = 204
expect(res.statusCode).toBeStatusCode(404);

would output:

Expected 204 (No Content) to be 404 (Not Found)

Also works with .not like this:

// res.statusCode = 204
expect(res.statusCode).not.toBeStatusCode(404);

would output:

Expected 204 (No Content) not to be 404 (Not Found)

FAQs

Package last updated on 22 Nov 2015

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