Socket
Socket
Sign inDemoInstall

jasmine-http-status-code-matcher

Package Overview
Dependencies
0
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jasmine-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
Created
Weekly downloads
 

Readme

Source

Jasmine HTTP status code matcher

Setup

Install via npm:

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

import in node:

var customMatchers = require('jasmine-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)

Keywords

FAQs

Last updated on 16 Jan 2016

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc