Add arguments object test for values methods.

This commit is contained in:
John-David Dalton
2016-04-18 08:47:18 -07:00
parent 30fd1693ee
commit ba58f35f37

View File

@@ -24274,6 +24274,7 @@
lodashStable.each(['values', 'valuesIn'], function(methodName) {
var args = (function() { return arguments; }(1, 2, 3)),
strictArgs = (function() { 'use strict'; return arguments; }(1, 2, 3)),
func = _[methodName],
isValues = methodName == 'values';
@@ -24308,6 +24309,19 @@
assert.deepEqual(actual, expected);
});
QUnit.test('`_.' + methodName + '` should work with `arguments` objects', function(assert) {
assert.expect(1);
var values = [args, strictArgs],
expected = lodashStable.map(values, lodashStable.constant([1, 2, 3]));
var actual = lodashStable.map(values, function(value) {
return func(value).sort();
});
assert.deepEqual(actual, expected);
});
});
/*--------------------------------------------------------------------------*/