Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
2
test/flip/flip.js
Normal file
2
test/flip/flip.js
Normal file
@ -0,0 +1,2 @@
|
||||
const flip = fn => (first, ...rest) => fn(...rest, first);
|
||||
module.exports = flip;
|
||||
14
test/flip/flip.test.js
Normal file
14
test/flip/flip.test.js
Normal file
@ -0,0 +1,14 @@
|
||||
const expect = require('expect');
|
||||
const flip = require('./flip.js');
|
||||
|
||||
|
||||
test('flip is a Function', () => {
|
||||
expect(flip).toBeInstanceOf(Function);
|
||||
});
|
||||
let a = { name: 'John Smith' };
|
||||
let b = {};
|
||||
const mergeFrom = flip(Object.assign);
|
||||
let mergePerson = mergeFrom.bind(null, a);
|
||||
t.deepEqual(mergePerson(b), a, 'Flips argument order');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user