Migrated tests to jest

Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
This commit is contained in:
Angelos Chalaris
2018-06-18 14:18:25 +03:00
parent ae8cd7ee50
commit 5afe81452a
890 changed files with 6950 additions and 6921 deletions

View File

@@ -1,6 +0,0 @@
const uncurry = (fn, n = 1) => (...args) => {
const next = acc => args => args.reduce((x, y) => x(y), acc);
if (n > args.length) throw new RangeError('Arguments too few!');
return next(fn)(args.slice(0, n));
};
module.exports = uncurry;

View File

@@ -1,20 +0,0 @@
const test = require('tape');
const uncurry = require('./uncurry.js');
test('Testing uncurry', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof uncurry === 'function', 'uncurry is a Function');
const add = x => y => z => x + y + z;
const add1 = uncurry(add);
const add2 = uncurry(add, 2);
const add3 = uncurry(add, 3);
t.equal(add1(1)(2)(3), 6, 'Works without a provided value for n');
t.equal(add2(1,2)(3), 6, 'Works without n = 2');
t.equal(add3(1,2,3), 6, 'Works withoutn = 3');
//t.deepEqual(uncurry(args..), 'Expected');
//t.equal(uncurry(args..), 'Expected');
//t.false(uncurry(args..), 'Expected');
//t.throws(uncurry(args..), 'Expected');
t.end();
});