From 4ba23b5090e4c618d421c8f64701ec4e67deb312 Mon Sep 17 00:00:00 2001 From: Bryan Jennings Date: Thu, 22 Jun 2023 12:13:18 -0700 Subject: [PATCH] Remove single-argument cReduce tests in js2/9 - The reason why we're removing the single-argument cReduce tests is because the cReduce descriptions says: "It is best practice to pass in 2 arguments into reduce function. Therefore, for this challenge, you can assume that when your function, cReduce, will always be called with 2 arguments: a function and initial value." - See the description for cReduce at: https://www.c0d3.com/curriculum/js2?challenge=129 --- js2/__tests__/9.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/js2/__tests__/9.js b/js2/__tests__/9.js index c7286c3a..071fee3f 100644 --- a/js2/__tests__/9.js +++ b/js2/__tests__/9.js @@ -41,22 +41,12 @@ describe('test cReduce', () => { const b = { bob: true, obo: false, boo: true } expect(a.cReduce(cb, {})).toEqual(b) }) - - it('should reduce the elements of [1,2,3,4] to 10', () => { - const cb = (ac, cv) => { - return ac + cv - } - const test = [1, 2, 3, 4] - expect(test.cReduce(cb)).toEqual(10) - - }) - it('should reduce ["1", "2", "3"] to "123"', () => { const cb = (ac, cv) => { return ac + cv } const a = ['1', '2', '3'] const b = '123' - expect(a.cReduce(cb)).toEqual(b) + expect(a.cReduce(cb, '')).toEqual(b) }) })