Files
30-seconds-of-code/test/bifurcateBy/bifurcateBy.test.js
Angelos Chalaris 4f1e8b48b6 Test files linted
2018-08-03 10:39:26 +03:00

13 lines
366 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']
]);
});