chai-json-equal
Assert on equality of json representations in Chai
Last updated 5 years ago by hurrymaplelad .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install chai-json-equal 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.0.1                                ...           latest (5 years ago)

2 Versions

  • 0.0.1                                ...           5 years ago
  • 0.0.0                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 12
This Month 17
Last Day 0
Last Week 5
Last Month 22
Dependencies (0)
None
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |