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
This commit is contained in:
HenMoshe
2022-03-10 06:47:02 +02:00
committed by GitHub
parent 7847d2a7b5
commit d3304276ca

View File

@ -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`.