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:
@ -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`.
|
||||
|
Reference in New Issue
Block a user