fix(curriculum): test for the key value pair challenge (#52302)

Co-authored-by: Jeremy L Thompson <jeremy@jeremylt.org>
This commit is contained in:
Sarah
2023-11-12 09:58:48 +03:00
committed by GitHub
parent ee9f65cfca
commit b236d861fa

View File

@@ -81,13 +81,13 @@ The `foods` object should have a key `strawberries` with a value of `27`.
assert(foods.strawberries === 27);
```
The key-value pairs should be set using dot or bracket notation.
The definition of the `foods` object should not be changed.
```js
assert(
code.search(/bananas:/) === -1 &&
code.search(/grapes:/) === -1 &&
code.search(/strawberries:/) === -1
code.search(/let foods/) === -1 &&
code.search(/const\s+foods\s*=\s*{\s*apples:\s*25,\s*oranges:\s*32,\s*plums:\s*28\s*};/
) !== -1
);
```
@@ -96,7 +96,7 @@ assert(
## --seed-contents--
```js
let foods = {
const foods = {
apples: 25,
oranges: 32,
plums: 28
@@ -112,7 +112,7 @@ console.log(foods);
# --solutions--
```js
let foods = {
const foods = {
apples: 25,
oranges: 32,
plums: 28