2018-04-02 19:01:53 +00:00
|
|
|
export default function(chai, utils) {
|
2017-01-19 15:16:56 +00:00
|
|
|
|
|
|
|
utils.addMethod(chai.Assertion.prototype, 'jsonEqual', function(comparison) {
|
|
|
|
|
|
|
|
var actual = JSON.stringify(this._obj);
|
|
|
|
var expected = JSON.stringify(comparison);
|
|
|
|
|
|
|
|
this.assert(
|
|
|
|
actual == expected,
|
|
|
|
'expected #{this} to deep equal #{act}',
|
|
|
|
'expected #{this} not to deep equal #{act}',
|
|
|
|
comparison, // expected
|
|
|
|
this._obj, // actual
|
|
|
|
true // show diff
|
|
|
|
);
|
|
|
|
});
|
2018-04-02 19:01:53 +00:00
|
|
|
}
|