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

26
test/min.spec.js Normal file
View File

@@ -0,0 +1,26 @@
import lodashStable from 'lodash';
import { falsey, noop } from './utils';
import min from '../src/min';
describe('min', () => {
it('should return the smallest value from a collection', () => {
expect(min([1, 2, 3])).toBe(1);
});
it('should return `undefined` for empty collections', () => {
const values = falsey.concat([[]]),
expected = lodashStable.map(values, noop);
const actual = lodashStable.map(values, (value: false, index: number) => {
try {
return index ? min(value) : min();
} catch (e) {}
});
expect(actual).toEqual(expected);
});
it('should work with non-numeric collection values', () => {
expect(min(['a', 'b'])).toBe('a');
});
});