mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Allow _.mixin to accept a destination object as well as a source object.
Former-commit-id: 11ccb77653f017270c07579f59d75b847d4e6c65
This commit is contained in:
18
test/test.js
18
test/test.js
@@ -2234,6 +2234,24 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.mixin');
|
||||
|
||||
(function() {
|
||||
test('should accept an `object` argument', function() {
|
||||
var lodash = {};
|
||||
_.mixin(lodash, { 'a': function(a) { return a[0]; } });
|
||||
strictEqual(lodash.a(['a']), 'a');
|
||||
});
|
||||
|
||||
test('should accept a function `object` argument', function() {
|
||||
var lodash = _.runInContext();
|
||||
_.mixin(lodash, { 'a': function(a) { return a[0]; } });
|
||||
strictEqual(lodash(['a']).a().value(), 'a');
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.omit');
|
||||
|
||||
(function() {
|
||||
|
||||
Reference in New Issue
Block a user