8000 Update calculator-solution.spec.js · hellogabor/javascript-exercises@f855eb5 · GitHub 8000
[go: up one dir, main page]

Skip to content

Commit f855eb5

Browse files
authored
Update calculator-solution.spec.js
1 parent e10ee03 commit f855eb5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

08_calculator/solution/calculator-solution.spec.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,30 +21,30 @@ describe('subtract', () => {
2121
});
2222

2323
describe('sum', () => {
24-
test('computes the sum of an empty parameter', () => {
25-
expect(calculator.sum()).toBe(0);
24+
test('computes the sum of an empty array', () => {
25+
expect(calculator.sum([])).toBe(0);
2626
});
2727

28-
test('computes the sum of one number', () => {
29-
expect(calculator.sum(7)).toBe(7);
28+
test('computes the sum of an array of one number', () => {
29+
expect(calculator.sum([7])).toBe(7);
3030
});
3131

32-
test('computes the sum of two numbers', () => {
33-
expect(calculator.sum(7, 11)).toBe(18);
32+
test('computes the sum of an array of two numbers', () => {
33+
expect(calculator.sum([7, 11])).toBe(18);
3434
});
3535

36-
test('computes the sum of many numbers', () => {
37-
expect(calculator.sum(1, 3, 5, 7, 9)).toBe(25);
36+
test('computes the sum of an array of many numbers', () => {
37+
expect(calculator.sum([1, 3, 5, 7, 9])).toBe(25);
3838
});
3939
});
4040

4141
describe('multiply', () => {
4242
test('multiplies two numbers', () => {
43-
expect(calculator.multiply(2, 4)).toBe(8);
43+
expect(calculator.multiply([2, 4])).toBe(8);
4444
});
4545

4646
test('multiplies several numbers', () => {
47-
expect(calculator.multiply(2, 4, 6, 8, 10, 12, 14)).toBe(645120);
47+
expect(calculator.multiply([2, 4, 6, 8, 10, 12, 14])).toBe(645120);
4848
});
4949
});
5050

0 commit comments

Comments
 (0)
0