Add archive snippet tests
This commit is contained in:
@ -4,3 +4,6 @@ const {fibonacciCountUntilNum} = require('./_30s.js');
|
|||||||
test('fibonacciCountUntilNum is a Function', () => {
|
test('fibonacciCountUntilNum is a Function', () => {
|
||||||
expect(fibonacciCountUntilNum).toBeInstanceOf(Function);
|
expect(fibonacciCountUntilNum).toBeInstanceOf(Function);
|
||||||
});
|
});
|
||||||
|
test('Returns the correct number', () => {
|
||||||
|
expect(fibonacciCountUntilNum(10)).toBe(7);
|
||||||
|
});
|
||||||
|
|||||||
@ -4,3 +4,6 @@ const {fibonacciUntilNum} = require('./_30s.js');
|
|||||||
test('fibonacciUntilNum is a Function', () => {
|
test('fibonacciUntilNum is a Function', () => {
|
||||||
expect(fibonacciUntilNum).toBeInstanceOf(Function);
|
expect(fibonacciUntilNum).toBeInstanceOf(Function);
|
||||||
});
|
});
|
||||||
|
test('Returns the correct sequence', () => {
|
||||||
|
expect(fibonacciUntilNum(10)).toEqual([0, 1, 1, 2, 3, 5, 8]);
|
||||||
|
});
|
||||||
|
|||||||
@ -4,3 +4,6 @@ const {heronArea} = require('./_30s.js');
|
|||||||
test('heronArea is a Function', () => {
|
test('heronArea is a Function', () => {
|
||||||
expect(heronArea).toBeInstanceOf(Function);
|
expect(heronArea).toBeInstanceOf(Function);
|
||||||
});
|
});
|
||||||
|
test('howManyTimes returns the correct result', () => {
|
||||||
|
expect(heronArea(3, 4, 5)).toBe(6);
|
||||||
|
});
|
||||||
|
|||||||
@ -4,3 +4,15 @@ const {howManyTimes} = require('./_30s.js');
|
|||||||
test('howManyTimes is a Function', () => {
|
test('howManyTimes is a Function', () => {
|
||||||
expect(howManyTimes).toBeInstanceOf(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);
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user