Add archive snippet tests

This commit is contained in:
Angelos Chalaris
2018-10-26 21:15:14 +03:00
parent 1cc4f5bdd5
commit 5982db073b
4 changed files with 21 additions and 0 deletions

View File

@ -4,3 +4,15 @@ const {howManyTimes} = require('./_30s.js');
test('howManyTimes is a Function', () => {
expect(howManyTimes).toBeInstanceOf(Function);
});
test('howManyTimes returns the correct result', () => {
expect(howManyTimes(100, 2)).toBe(2);
});
test('howManyTimes returns the correct result', () => {
expect(howManyTimes(100, 2.5)).toBe(2);
});
test('howManyTimes returns the correct result', () => {
expect(howManyTimes(100, 0)).toBe(0);
});
test('howManyTimes returns the correct result', () => {
expect(howManyTimes(100, -1)).toBe(Infinity);
});