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

@ -5,13 +5,17 @@ const collatz = require('./collatz.js');
test('collatz is a Function', () => {
expect(collatz).toBeInstanceOf(Function);
});
t.equal(collatz(8), 4, 'When n is even, divide by 2');
t.equal(collatz(9), 28, 'When n is odd, times by 3 and add 1');
test('When n is even, divide by 2', () => {
expect(collatz(8), 4).toBe()
});
test('When n is odd, times by 3 and add 1', () => {
expect(collatz(9), 28).toBe()
});
let n = 9;
while(true){
if (n === 1){
t.pass('Eventually reaches 1');
break;
}
n = collatz(n);