Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
2
test/over/over.js
Normal file
2
test/over/over.js
Normal file
@ -0,0 +1,2 @@
|
||||
const over = (...fns) => (...args) => fns.map(fn => fn.apply(null, args));
|
||||
module.exports = over;
|
||||
11
test/over/over.test.js
Normal file
11
test/over/over.test.js
Normal file
@ -0,0 +1,11 @@
|
||||
const expect = require('expect');
|
||||
const over = require('./over.js');
|
||||
|
||||
|
||||
test('over is a Function', () => {
|
||||
expect(over).toBeInstanceOf(Function);
|
||||
});
|
||||
const minMax = over(Math.min, Math.max);
|
||||
t.deepEqual(minMax(1, 2, 3, 4, 5), [1,5], 'Applies given functions over multiple arguments');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user