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 977949ca61
commit 4f7da1be9b
894 changed files with 5917 additions and 3607 deletions

5
test/unionBy/unionBy.js Normal file
View File

@ -0,0 +1,5 @@
const unionBy = (a, b, fn) => {
const s = new Set(a.map(v => fn(v)));
return Array.from(new Set([...a, ...b.filter(x => !s.has(fn(x)))]));
};
module.exports = unionBy;

View File

@ -0,0 +1,10 @@
const expect = require('expect');
const unionBy = require('./unionBy.js');
test('unionBy is a Function', () => {
expect(unionBy).toBeInstanceOf(Function);
});
t.deepEqual(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2], 'Produces the appropriate results');