From d3304276ca99e8f270149eaffcdd4f642cb02d61 Mon Sep 17 00:00:00 2001 From: HenMoshe <91905102+HenMoshe@users.noreply.github.com> Date: Thu, 10 Mar 2022 06:47:02 +0200 Subject: [PATCH] fix(curriculum) : Make tests stricter for challenge "Decrement a number with javascript" (#45242) * Make tests stricter for challenge "Decrement a number with javascript" #44648 * Update decrement-a-number-with-javascript.md --- .../decrement-a-number-with-javascript.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md index 373d97e2bd..3c5cb464e6 100644 --- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md +++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md @@ -38,9 +38,13 @@ assert(myVar === 10); `myVar = myVar - 1;` should be changed. ```js -assert( - /let\s*myVar\s*=\s*11;\s*\/*.*\s*([-]{2}\s*myVar|myVar\s*[-]{2});/.test(code) -); +assert(!code.match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/)); +``` + +You should not assign `myVar` with `10`. + +```js +assert(!code.match(/myVar\s*=\s*10.*?;?/)); ``` You should use the `--` operator on `myVar`.