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

Function mirrorPropAsAssertion

test/helpers/sinon.js:4676–4701  ·  view source on GitHub ↗
(name, method, message)

Source from the content-addressed store, hash-verified

4674 }
4675
4676 function mirrorPropAsAssertion(name, method, message) {
4677 if (arguments.length == 2) {
4678 message = method;
4679 method = name;
4680 }
4681
4682 assert[name] = function (fake) {
4683 verifyIsStub(fake);
4684
4685 var args = slice.call(arguments, 1);
4686 var failed = false;
4687
4688 if (typeof method == "function") {
4689 failed = !method(fake);
4690 } else {
4691 failed = typeof fake[method] == "function" ?
4692 !fake[method].apply(fake, args) : !fake[method];
4693 }
4694
4695 if (failed) {
4696 failAssertion(this, fake.printf.apply(fake, [message].concat(args)));
4697 } else {
4698 assert.pass(name);
4699 }
4700 };
4701 }
4702
4703 function exposedName(prefix, prop) {
4704 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…