jasmine-http-status-code-matcher

1.0.2 • Public • Published

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)

Package Sidebar

Install

npm i jasmine-http-status-code-matcher

Weekly Downloads

1

Version

1.0.2

License

ISC

Last publish

Collaborators

  • timperry