From 8f9913d02b49572903dec360e8fdfce812ef3a33 Mon Sep 17 00:00:00 2001 From: Josh <40269551+praizjosh@users.noreply.github.com> Date: Tue, 7 May 2024 15:11:30 +0100 Subject: [PATCH] fix(curriculum): fix tests for step 43 of shopping cart project (#54631) --- .../63f02a4ef92d711ec1ff618c.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-oop-by-building-a-shopping-cart/63f02a4ef92d711ec1ff618c.md b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-oop-by-building-a-shopping-cart/63f02a4ef92d711ec1ff618c.md index 354ea3f9427..a8e3a43707d 100644 --- a/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-oop-by-building-a-shopping-cart/63f02a4ef92d711ec1ff618c.md +++ b/curriculum/challenges/english/15-javascript-algorithms-and-data-structures-22/learn-basic-oop-by-building-a-shopping-cart/63f02a4ef92d711ec1ff618c.md @@ -46,14 +46,14 @@ Your `reduce` callback should return the sum of `total` and `item.price`. Use an ```js const afterCalculateTotal = code.split('calculateTotal')[1]; -assert.match(afterCalculateTotal, /\(\s*total\s*,\s*item\s*\)\s*=>\s*total\s*\+\s*item\.price/); +assert.match(afterCalculateTotal, /\(\s*total\s*,\s*item\s*\)\s*=>\s*(?:total\s*\+\s*item\.price|item\.price\s*\+\s*total)/); ``` Your `reduce` call should have an initial value of `0`. ```js const afterCalculateTotal = code.split('calculateTotal')[1]; -assert.match(afterCalculateTotal, /this\s*\.\s*items\s*\.\s*reduce\s*\(\s*\(\s*total\s*,\s*item\s*\)\s*=>\s*total\s*\+\s*item\.price\s*,\s*0\s*\)/); +assert.match(afterCalculateTotal, /this\s*\.\s*items\s*\.\s*reduce\s*\(\s*\(\s*total\s*,\s*item\s*\)\s*=>\s*(?:total\s*\+\s*item\.price|item\.price\s*\+\s*total)\s*,\s*0\s*\)/); ``` # --seed--