Skip to content

Commit b6e9e2f

Browse files
authored
Removed array syntax in multiply test
The test for the 'multiply' function used array brackets [] for the input parameters, which caused the test to return an error when rest parameters (...args) are used in the function, like so: const multiply = function(...args){ return args.reduce((acc, cur) => acc * cur); }
1 parent 3e530e3 commit b6e9e2f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

08_calculator/calculator.spec.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ describe('sum', () => {
4040

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

4646
test.skip('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)