1 import remove from './remove';
3 describe('remove()', () => {
4 it('removes an item from an array', () => {
5 const output = remove(['a', 'b', 'c'], 'b');
6 expect(output).toEqual(['a', 'c']);
9 it('removes only the first occurence should there be multiple', () => {
10 const output = remove(['a', 'b', 'c', 'b', 'd', 'b'], 'b');
11 expect(output).toEqual(['a', 'c', 'b', 'd', 'b']);
14 it('returns the original array if the given element does not occur in the input array', () => {
15 const input = ['a', 'b', 'c', 'd'];
16 const output = remove(input, 'e');
17 expect(output).toBe(input);