Files
jasmine/src/core/matchers/toContain.js
Gregg Van Hove 9cb2f06aa6 Add a first pass at jsdoc.
[##130415655] #596
2017-03-21 11:36:41 -07:00

26 lines
633 B
JavaScript

getJasmineRequireObj().toContain = function() {
/**
* {@link expect} the actual value to contain a specific value.
* @function
* @name matchers#toContain
* @param {Object} expected - The value to look for.
* @example
* expect(array).toContain(anElement);
* expect(string).toContain(substring);
*/
function toContain(util, customEqualityTesters) {
customEqualityTesters = customEqualityTesters || [];
return {
compare: function(actual, expected) {
return {
pass: util.contains(actual, expected, customEqualityTesters)
};
}
};
}
return toContain;
};