Files
jasmine/src/core/matchers/toBeTruthy.js
2019-06-12 16:23:12 -07:00

22 lines
393 B
JavaScript

getJasmineRequireObj().toBeTruthy = function() {
/**
* {@link expect} the actual value to be truthy.
* @function
* @name matchers#toBeTruthy
* @since 2.0.0
* @example
* expect(thing).toBeTruthy();
*/
function toBeTruthy() {
return {
compare: function(actual) {
return {
pass: !!actual
};
}
};
}
return toBeTruthy;
};