-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.test.js
40 lines (31 loc) · 902 Bytes
/
index.test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
const {fibonacci, fibonacciRecursiveWay} = require('.');
test('fibonacci should be return the sequence of number 1', () => {
// Arrange
const number = 2;
// Act
const result = fibonacci(number);
const resultTwo = fibonacciRecursiveWay(number);
// Assert
expect(result).toEqual(2);
expect(resultTwo).toEqual(2);
})
test('fibonacci should be return the sequence of number 3', () => {
// Arrange
const number = 3;
// Act
const result = fibonacci(number);
const resultTwo = fibonacciRecursiveWay(number);
// Assert
expect(result).toEqual(3);
expect(resultTwo).toEqual(3);
})
test('fibonacci should be return the sequence of number 13', () => {
// Arrange
const number = 13;
// Act
const result = fibonacci(number);
const resultTwo = fibonacciRecursiveWay(number);
// Assert
expect(result).toEqual(377);
expect(resultTwo).toEqual(377);
})