Test cleanup and fixes [u-v]

This commit is contained in:
Angelos Chalaris
2018-06-18 18:52:13 +03:00
parent 46ad6c08b9
commit c0a42d906a
16 changed files with 135 additions and 157 deletions

View File

@ -1,22 +1,19 @@
const expect = require('expect');
const uncurry = require('./uncurry.js');
test('uncurry is a Function', () => {
test('uncurry is a Function', () => {
expect(uncurry).toBeInstanceOf(Function);
});
const add = x => y => z => x + y + z;
const add1 = uncurry(add);
const add2 = uncurry(add, 2);
const add3 = uncurry(add, 3);
test('Works without a provided value for n', () => {
expect(add1(1)(2)(3), 6).toBe()
const add = x => y => z => x + y + z;
const add1 = uncurry(add);
const add2 = uncurry(add, 2);
const add3 = uncurry(add, 3);
test('Works without a provided value for n', () => {
expect(add1(1)(2)(3)).toBe(6);
});
test('Works without n = 2', () => {
expect(add2(1,2)(3), 6).toBe()
test('Works with n = 2', () => {
expect(add2(1,2)(3)).toBe(6);
});
test('Works withoutn = 3', () => {
expect(add3(1,2,3), 6).toBe()
test('Works with n = 3', () => {
expect(add3(1,2,3)).toBe(6);
});