bpmn-js/test/matchers/JSONMatcher.js
Nico Rehwaldt 9be61259bd chore(project): drop 'use strict'
We use ES modules, so 'use strict' is not necessary anymore.
2018-04-03 18:09:53 +02:00

18 lines
450 B
JavaScript

export default function(chai, utils) {
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
);
});
}