Skip to content

hurrymaplelad/chai-json-equal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);

About

Assert on equality of json representations

Resources

Stars

Watchers

Forks

Packages

No packages published