MCPcopy
hub / github.com/Leaflet/Leaflet.markercluster / mirrorPropAsAssertion

Function mirrorPropAsAssertion

spec/sinon.js:4101–4126  ·  view source on GitHub ↗
(name, method, message)

Source from the content-addressed store, hash-verified

4099 }
4100
4101 function mirrorPropAsAssertion(name, method, message) {
4102 if (arguments.length == 2) {
4103 message = method;
4104 method = name;
4105 }
4106
4107 assert[name] = function (fake) {
4108 verifyIsStub(fake);
4109
4110 var args = slice.call(arguments, 1);
4111 var failed = false;
4112
4113 if (typeof method == "function") {
4114 failed = !method(fake);
4115 } else {
4116 failed = typeof fake[method] == "function" ?
4117 !fake[method].apply(fake, args) : !fake[method];
4118 }
4119
4120 if (failed) {
4121 failAssertion(this, fake.printf.apply(fake, [message].concat(args)));
4122 } else {
4123 assert.pass(name);
4124 }
4125 };
4126 }
4127
4128 function exposedName(prefix, prop) {
4129 return !prefix || /^fail/.test(prop) ? prop :

Callers 1

sinon.jsFile · 0.85

Calls 2

verifyIsStubFunction · 0.85
failAssertionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…