From 358406f12becb20701ad28ec28da3fd974fd4e95 Mon Sep 17 00:00:00 2001 From: Aaron Jensen Date: Sun, 23 Aug 2015 10:48:32 -0700 Subject: [PATCH] Add spec for reject by index --- test/reject-spec.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/reject-spec.js b/test/reject-spec.js index 5d62f16..1a4cf2a 100644 --- a/test/reject-spec.js +++ b/test/reject-spec.js @@ -2,6 +2,12 @@ import { expect } from 'chai'; import u from '../lib'; 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', () => { expect(Object.isFrozen(u.reject('a', []))).to.be.true; });