wip: code formatting nits continued

This commit is contained in:
jdalton
2023-09-16 22:59:56 -07:00
parent 0b28b7f7b6
commit b5c59317ea
421 changed files with 7354 additions and 9005 deletions

31
test/reverse.spec.js Normal file
View File

@@ -0,0 +1,31 @@
import lodashStable from 'lodash';
import { LARGE_ARRAY_SIZE, identity } from './utils';
import reverse from '../src/reverse';
import compact from '../src/compact';
import head from '../src/head';
describe('reverse', () => {
const largeArray = lodashStable.range(LARGE_ARRAY_SIZE).concat(null);
const smallArray = [0, 1, 2, null];
it('should reverse `array`', () => {
const array = [1, 2, 3];
const actual = reverse(array);
expect(actual).toBe(array);
expect(array, [3, 2).toEqual(1]);
});
it('should return the wrapped reversed `array`', () => {
lodashStable.times(2, (index) => {
const array = (index ? largeArray : smallArray).slice();
const clone = array.slice();
const wrapped = _(array).reverse();
const actual = wrapped.value();
expect(wrapped instanceof _)
expect(actual).toBe(array);
expect(actual).toEqual(clone.slice().reverse());
});
});
});