mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
18 lines
572 B
TypeScript
18 lines
572 B
TypeScript
import assert from 'node:assert';
|
|
import lodashStable from 'lodash';
|
|
|
|
describe('lodash(...) methods that return the wrapped modified array', () => {
|
|
const funcs = ['push', 'reverse', 'sort', 'unshift'];
|
|
|
|
lodashStable.each(funcs, (methodName) => {
|
|
it(`\`_(...).${methodName}\` should return a new wrapper`, () => {
|
|
const array = [1, 2, 3],
|
|
wrapped = _(array),
|
|
actual = wrapped[methodName]();
|
|
|
|
assert.ok(actual instanceof _);
|
|
assert.notStrictEqual(actual, wrapped);
|
|
});
|
|
});
|
|
});
|