Files
30-seconds-of-code/test/bifurcateBy/bifurcateBy.test.js
2018-06-18 15:54:48 +03:00

10 lines
358 B
JavaScript

const expect = require('expect');
const bifurcateBy = require('./bifurcateBy.js');
test('bifurcateBy is a Function', () => {
expect(bifurcateBy).toBeInstanceOf(Function);
});
test('Splits the collection into two groups', () => {
expect(bifurcateBy([ 'beep', 'boop', 'foo', 'bar' ], x => x[0] === 'b')).toEqual([ ['beep', 'boop', 'bar'], ['foo'] ]);
});