mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): test that contacts array is not modified in lab profile lookup (#65032)
Co-authored-by: Krzysztof G. <60067306+gikf@users.noreply.github.com>
This commit is contained in:
+10
-1
@@ -24,7 +24,7 @@ For this example imagine there is a contact named Akira Laine, the `lookUpProfil
|
||||
# --before-each--
|
||||
|
||||
```js
|
||||
contacts = [
|
||||
const _contacts = [
|
||||
{
|
||||
firstName: "Akira",
|
||||
lastName: "Laine",
|
||||
@@ -50,6 +50,8 @@ contacts = [
|
||||
likes: ["JavaScript", "Gaming", "Foxes"],
|
||||
},
|
||||
];
|
||||
|
||||
contacts = structuredClone(_contacts);
|
||||
```
|
||||
|
||||
# --hints--
|
||||
@@ -111,6 +113,13 @@ assert.strictEqual(lookUpProfile('Bob', 'potato'), 'No such contact');
|
||||
assert.strictEqual(lookUpProfile('Akira', 'address'), 'No such property');
|
||||
```
|
||||
|
||||
The `contacts` array should remain unchanged after running `lookUpProfile`
|
||||
|
||||
```js
|
||||
lookUpProfile("Sherlock", "likes");
|
||||
assert.deepEqual(contacts,_contacts);
|
||||
```
|
||||
|
||||
# --seed--
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
Reference in New Issue
Block a user