Files
jasmine/src/core/matchers/toContain.js
2020-09-29 18:05:38 -07:00

24 lines
562 B
JavaScript

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