fix(cirriculum): fix tests to allow for multiple correct solutions for step 97 OOP game (#53295)

Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
a2937
2024-01-25 15:14:48 -05:00
committed by GitHub
parent 76feadc807
commit d55abbc984

View File

@@ -24,13 +24,13 @@ assert.match(code, /\bcheckpoints\b\s*\.\s*forEach\s*\(/s);
You should have a `checkpoint` parameter inside the `forEach` callback function.
```js
assert.match(code, /\s*checkpoints\s*\.\s*forEach\s*\(\s*checkpoint\s*=>\s*{/s);
assert.match(code, /\s*checkpoints\s*\.\s*forEach\s*\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*{?/s);
```
You should call the `draw` method on each `checkpoint` inside the `forEach` callback function.
```js
assert.match(code, /\s*checkpoints\.forEach\s*\(\s*checkpoint\s*=>\s*{\s*checkpoint\.draw\(\s*\);?\s*}\s*\);?/s);
assert.match(code, /\s*checkpoints\.forEach\s*\(\s*(\(\s*checkpoint\s*\)|checkpoint)\s*=>\s*(\{\s*checkpoint\.draw\(\s*\)\s*;?\s*\}|checkpoint\.draw\(\s*\))\s*\)\s*;?/s);
```
# --seed--