UNPKG

chai-callslike

Version:

A simple sinon-chai assertion to validate many aspects of stub calls

22 lines (21 loc) 671 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mustGoDeep = void 0; const is_json_comparable_1 = require("./is-json-comparable"); const is_matcher_1 = require("./is-matcher"); function mustGoDeep(a, e, references) { const result = is_json_comparable_1.isJsonComparable(a) && is_json_comparable_1.isJsonComparable(e) && !references.has(a) && !references.has(e); if (result) { if (!is_matcher_1.isMatcher(a)) { references.add(a); } if (!is_matcher_1.isMatcher(e)) { references.add(e); } } return result; } exports.mustGoDeep = mustGoDeep;