From b6e9e2fac364db2fb0352f01adcd0bfd0d862b70 Mon Sep 17 00:00:00 2001 From: fruddenfeldt <80771026+fruddenfeldt@users.noreply.github.com> Date: Mon, 22 May 2023 21:08:37 +0200 Subject: [PATCH] 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); } --- 08_calculator/calculator.spec.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/08_calculator/calculator.spec.js b/08_calculator/calculator.spec.js index dc317ec..3507452 100644 --- a/08_calculator/calculator.spec.js +++ b/08_calculator/calculator.spec.js @@ -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); }); });