Add spec for reject by index
This commit is contained in:
parent
6437d98f73
commit
358406f12b
@ -2,6 +2,12 @@ import { expect } from 'chai';
|
|||||||
import u from '../lib';
|
import u from '../lib';
|
||||||
|
|
||||||
describe('u.reject', () => {
|
describe('u.reject', () => {
|
||||||
|
it('can reject by index', () => {
|
||||||
|
const result = u.reject((_, index) => index === 1, [3, 4, 5]);
|
||||||
|
|
||||||
|
expect(result).to.eql([3, 5]);
|
||||||
|
});
|
||||||
|
|
||||||
it('freezes the result', () => {
|
it('freezes the result', () => {
|
||||||
expect(Object.isFrozen(u.reject('a', []))).to.be.true;
|
expect(Object.isFrozen(u.reject('a', []))).to.be.true;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user