MCPcopy
hub / github.com/Semantic-Org/Semantic-UI / matchObject

Function matchObject

test/helpers/sinon.js:1039–1061  ·  view source on GitHub ↗
(expectation, actual)

Source from the content-addressed store, hash-verified

1037 }
1038
1039 function matchObject(expectation, actual) {
1040 if (actual === null || actual === undefined) {
1041 return false;
1042 }
1043 for (var key in expectation) {
1044 if (expectation.hasOwnProperty(key)) {
1045 var exp = expectation[key];
1046 var act = actual[key];
1047 if (match.isMatcher(exp)) {
1048 if (!exp.test(act)) {
1049 return false;
1050 }
1051 } else if (sinon.typeOf(exp) === "object") {
1052 if (!matchObject(exp, act)) {
1053 return false;
1054 }
1055 } else if (!sinon.deepEqual(exp, act)) {
1056 return false;
1057 }
1058 }
1059 }
1060 return true;
1061 }
1062
1063 matcher.or = function (m2) {
1064 if (!arguments.length) {

Callers 1

matchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…