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); }
This commit is contained in:
parent
3e530e3f61
commit
b6e9e2fac3
1 changed files with 2 additions and 2 deletions
|
@ -40,11 +40,11 @@ describe('sum', () => {
|
|||
|
||||
describe('multiply', () => {
|
||||
test.skip('multiplies two numbers', () => {
|
||||
expect(calculator.multiply([2,4])).toBe(8);
|
||||
expect(calculator.multiply(2,4)).toBe(8);
|
||||
});
|
||||
|
||||
test.skip('multiplies several numbers', () => {
|
||||
expect(calculator.multiply([2,4,6,8,10,12,14])).toBe(645120);
|
||||
expect(calculator.multiply(2,4,6,8,10,12,14)).toBe(645120);
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue