Updated the test system
This commit is contained in:
13
test/partition.test.js
Normal file
13
test/partition.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const expect = require('expect');
|
||||
const {partition} = require('./_30s.js');
|
||||
|
||||
test('partition is a Function', () => {
|
||||
expect(partition).toBeInstanceOf(Function);
|
||||
});
|
||||
const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }];
|
||||
test("Groups the elements into two arrays, depending on the provided function's truthiness for each element.", () => {
|
||||
expect(partition(users, o => o.active)).toEqual([
|
||||
[{ user: 'fred', age: 40, active: true }],
|
||||
[{ user: 'barney', age: 36, active: false }]
|
||||
]);
|
||||
});
|
||||
Reference in New Issue
Block a user