bpmn-js/test/matchers/JSONMatcher.js
Nico Rehwaldt d3449ca87c chore(project): es6ify source code
* use ES6 import / export
* UTILS: export individual utilities
* TESTS: localize TestHelper includes

BREAKING CHANGE:

* all utilities export independent functions
* library sources got ported to ES6. You must now use
  a ES module bundler such as Browserify + babelify or
  Webpack to consume this library (or parts of it).
2018-04-03 16:32:14 +02:00

20 lines
465 B
JavaScript

'use strict';
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
);
});
}