Updated the test system

This commit is contained in:
Angelos Chalaris
2018-10-10 23:36:17 +03:00
parent 6479590abf
commit 0bc5d38f85
725 changed files with 385 additions and 2332 deletions

12
test/overArgs.test.js Normal file
View File

@ -0,0 +1,12 @@
const expect = require('expect');
const {overArgs} = require('./_30s.js');
test('overArgs is a Function', () => {
expect(overArgs).toBeInstanceOf(Function);
});
const square = n => n * n;
const double = n => n * 2;
const fn = overArgs((x, y) => [x, y], [square, double]);
test('Invokes the provided function with its arguments transformed', () => {
expect(fn(9, 3)).toEqual([81, 6]);
});