Add spec for reject by index

This commit is contained in:
Aaron Jensen 2015-08-23 10:48:32 -07:00
parent 6437d98f73
commit 358406f12b

View File

@ -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;
}); });