mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Add arguments object test for values methods.
This commit is contained in:
14
test/test.js
14
test/test.js
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user