test: migrate JSONMatcher to new chai API

Already using it for other matchers.
This commit is contained in:
Nico Rehwaldt 2021-06-23 09:19:01 +02:00 committed by Philipp Fromme
parent 68bc49a812
commit e24fa02b2c

View File

@ -1,6 +1,8 @@
export default function(chai, utils) {
utils.addMethod(chai.Assertion.prototype, 'jsonEqual', function(comparison, filter) {
var Assertion = chai.Assertion;
Assertion.addMethod('jsonEqual', function(comparison, filter) {
var actual = JSON.stringify(this._obj, filter, ' ');
var expected = JSON.stringify(comparison, filter, ' ');