fix(curriculum): add test for nested objects challenge (#51902)

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Vedaant Rajoo
2023-10-11 14:09:03 +05:30
committed by GitHub
parent d7e0f59528
commit dd05517242

View File

@@ -54,7 +54,24 @@ assert.match(code, /myStorage\.car\.inside/);
`gloveBoxContents` should still be declared with `const`.
```js
assert.match(code, /const\s+gloveBoxContents\s*=\s*myStorage\.car\.inside\[\s*("|')glove box\1\s*\]|const\s*{\s*('|")glove box\2:\s*gloveBoxContents\s*}\s*=\s*myStorage\.car\.inside;/);
assert.match(code, /const\s+gloveBoxContents\s*=/);
```
You should not change the `myStorage` object.
```js
const expectedMyStorage = {
"car":{
"inside":{
"glove box":"maps",
"passenger seat":"crumbs"
},
"outside":{
"trunk":"jack"
}
}
};
assert.deepStrictEqual(myStorage, expectedMyStorage);
```
# --seed--