UNPKG

assertthat

Version:
18 lines (17 loc) 726 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.assertAnyIsNotSameJsonAsExpected = void 0; const errors_1 = require("../../errors"); const defekt_1 = require("defekt"); const assertAnyIsNotSameJsonAsExpected = function (actual, expected) { const actualJson = JSON.stringify(actual); const expectedJson = JSON.stringify(expected); if (actualJson !== expectedJson) { return (0, defekt_1.value)(); } return (0, defekt_1.error)(new errors_1.AssertionFailed({ message: 'The values have the same JSON representation.', expected: `Not to equal:\n${expectedJson}` })); }; exports.assertAnyIsNotSameJsonAsExpected = assertAnyIsNotSameJsonAsExpected;