JSPM

chai-json-equal

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3818
  • Score
    100M100P100Q133501F
  • License MIT

Assert on equality of json representations in Chai

Package Exports

  • chai-json-equal

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (chai-json-equal) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

chai-json-equal

Assert on equality of json representations in Chai.

NPM version Build Status

var ship = "ship",
    barge = {toJSON: function () {
      return "ship";
    }}
ship.should.jsonEqual(barge);

You can also compare array members with JSON equality:

[ship].should.have.jsonEqual.members [barge]

Installation

This is a plugin for the Chai Assertion Library. Install via npm.

npm install chai-json-equal

Plugin

Use this plugin as you would all other Chai plugins.

var chai = require('chai')
  , chaiJsonEqual = require('chai-json-equal');

chai.use(chaiJsonEqual);