Test cleanup and fixes [a-b]

This commit is contained in:
Angelos Chalaris
2018-06-18 15:54:48 +03:00
parent a78f5db260
commit 026c65a5e6
151 changed files with 753 additions and 373 deletions

View File

@ -7,8 +7,14 @@ const memoize = require('./memoize.js');
});
const f = x => x * x;
const square = memoize(f);
t.equal(square(2), 4, 'Function works properly');
t.equal(square(3), 9, 'Function works properly');
t.deepEqual(Array.from(square.cache), [[2,4],[3,9]], 'Cache stores values');
test('Function works properly', () => {
expect(square(2), 4).toBe()
});
test('Function works properly', () => {
expect(square(3), 9).toBe()
});
test('Cache stores values', () => {
expect(Array.from(square.cache), [[2,4],[3,9]]).toEqual()
});