forked from TheOdinProject/javascript-exercises
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpascal-solution.spec.js
More file actions
31 lines (24 loc) · 790 Bytes
/
pascal-solution.spec.js
File metadata and controls
31 lines (24 loc) · 790 Bytes
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
const pascal = require('./pascal-solution');
describe('pascal', () => {
test('Gets the first row of pascal', () => {
expect(pascal(1)).toEqual([1]);
});
test('Gets the second row of pascal', () => {
expect(pascal(2)).toEqual([1, 1]);
});
test('Gets the third row of pascal', () => {
expect(pascal(3)).toEqual([1, 2, 1]);
});
test('Gets the fourth row of pascal', () => {
expect(pascal(4)).toEqual([1, 3, 3, 1]);
});
test('Gets the fifth row of pascal', () => {
expect(pascal(5)).toEqual([1, 4, 6, 4, 1]);
});
test('Gets the sixth row of pascal', () => {
expect(pascal(6)).toEqual([1, 5, 10, 10, 5, 1]);
});
test('Gets the seventh row of pascal', () => {
expect(pascal(7)).toEqual([1, 6, 15, 20, 15, 6, 1]);
});
});