Test migration to jest by hand

Apparently using regular expressions is way easier.
This commit is contained in:
Angelos Chalaris
2018-06-18 15:15:56 +03:00
parent 5df7098fac
commit a78f5db260
894 changed files with 5917 additions and 3607 deletions

6
test/mapKeys/mapKeys.js Normal file
View File

@ -0,0 +1,6 @@
const mapKeys = (obj, fn) =>
Object.keys(obj).reduce((acc, k) => {
acc[fn(obj[k], k, obj)] = obj[k];
return acc;
}, {
module.exports = mapKeys;

View File

@ -0,0 +1,10 @@
const expect = require('expect');
const mapKeys = require('./mapKeys.js');
test('mapKeys is a Function', () => {
expect(mapKeys).toBeInstanceOf(Function);
});
t.deepEqual(mapKeys({ a: 1, b: 2 }, (val, key) => key + val), { a1: 1, b2: 2 }, 'Maps keys');