Make _.contains work with strings similar ES6 draft String#contains.

Former-commit-id: 3cfffdcddec3e1e8175da95043ec86ac3c6a85fe
This commit is contained in:
John-David Dalton
2012-07-11 01:11:25 -04:00
parent b9bade8d5a
commit cbdc9c0be1
4 changed files with 39 additions and 4 deletions

View File

@@ -132,6 +132,23 @@
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.contains');
(function() {
_.each([
{ 'kind': 'literal', 'value': 'abc' },
{ 'kind': 'object', 'value': Object('abc') }
],
function(data) {
test('should work with a string ' + data.kind + ' for `collection`', function() {
equal(_.contains(data.value, 'bc'), true);
equal(_.contains(data.value, 'd'), false);
});
});
}());
/*--------------------------------------------------------------------------*/
QUnit.module('lodash.debounce');
(function() {