MCPcopy
hub / github.com/plotly/plotly.js / negateIf

Function negateIf

test/jasmine/assets/negate_if.js:15–19  ·  view source on GitHub ↗

* Helpers that can negate an expectation given a condition * * @param {boolean OR function} condition * @param {jasmine expect return} expectation * @returns {jasmine expect return} * * Example: * * negateIf(myCondition, expect(actual)).toBe(expected); *

(condition, expectation)

Source from the content-addressed store, hash-verified

13 *
14 */
15function negateIf(condition, expectation) {
16 return (typeof condition === 'function' ? condition() : condition) ?
17 expectation.not :
18 expectation;
19}
20
21module.exports = negateIf;

Callers 9

assertTitleFunction · 0.85
checkFillFunction · 0.85
_assertFunction · 0.85
assertCBFunction · 0.85
checkFunction · 0.85
_assertFunction · 0.85
axes_test.jsFile · 0.85
checkBarsMatchFunction · 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…