* 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)
| 13 | * |
| 14 | */ |
| 15 | function negateIf(condition, expectation) { |
| 16 | return (typeof condition === 'function' ? condition() : condition) ? |
| 17 | expectation.not : |
| 18 | expectation; |
| 19 | } |
| 20 | |
| 21 | module.exports = negateIf; |
no outgoing calls
no test coverage detected
searching dependent graphs…