Files
30-seconds-of-code/test/bifurcateBy.test.js
2018-10-19 20:18:00 +03:00

13 lines
361 B
JavaScript

const expect = require('expect');
const {bifurcateBy} = require('./_30s.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']
]);
});