Skip to content

Commit 8fe75f2

Browse files
committed
feat(pascal): create tests for exercise
1 parent 0e00b59 commit 8fe75f2

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed
Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,31 @@
11
const pascal = require('./pascal-solution');
22

33
describe('pascal', () => {
4-
test('First test description', () => {
5-
// Replace this comment with any other necessary code, and update the expect line as necessary
6-
7-
expect(pascal()).toBe('');
4+
test('Gets the first row of pascal', () => {
5+
expect(pascal(1)).toEqual([1]);
86
});
97

10-
test('Second test description', () => {
11-
// Replace this comment with any other necessary code, and update the expect line as necessary
12-
13-
expect(pascal()).toBe('');
8+
test('Gets the second row of pascal', () => {
9+
expect(pascal(2)).toEqual([1, 1]);
10+
});
11+
12+
test('Gets the third row of pascal', () => {
13+
expect(pascal(3)).toEqual([1, 2, 1]);
14+
});
15+
16+
test('Gets the fourth row of pascal', () => {
17+
expect(pascal(4)).toEqual([1, 3, 3, 1]);
18+
});
19+
20+
test('Gets the fifth row of pascal', () => {
21+
expect(pascal(5)).toEqual([1, 4, 6, 4, 1]);
22+
});
23+
24+
test('Gets the sixth row of pascal', () => {
25+
expect(pascal(6)).toEqual([1, 5, 10, 10, 5, 1]);
26+
});
27+
28+
test('Gets the seventh row of pascal', () => {
29+
expect(pascal(7)).toEqual([1, 6, 15, 20, 15, 6, 1]);
1430
});
1531
});

0 commit comments

Comments
 (0)