Updated the test system
This commit is contained in:
13
test/mapValues.test.js
Normal file
13
test/mapValues.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const expect = require('expect');
|
||||
const {mapValues} = require('./_30s.js');
|
||||
|
||||
test('mapValues is a Function', () => {
|
||||
expect(mapValues).toBeInstanceOf(Function);
|
||||
});
|
||||
const users = {
|
||||
fred: { user: 'fred', age: 40 },
|
||||
pebbles: { user: 'pebbles', age: 1 }
|
||||
};
|
||||
test('Maps values', () => {
|
||||
expect(mapValues(users, u => u.age)).toEqual({ fred: 40, pebbles: 1 });
|
||||
});
|
||||
Reference in New Issue
Block a user