fix(curriculum): Added test to Return a Sorted Array Without Changing the Original Array challenge to validate new array is returned (#38105)
* fix: added test to validate new array is returned * fix: changed text to reflect changed test Co-Authored-By: Oliver Eyton-Williams <ojeytonwilliams@gmail.com> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
parent
5b80595fbf
commit
78156a65f0
@ -27,7 +27,9 @@ tests:
|
||||
- text: <code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>.
|
||||
testString: assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9]));
|
||||
- text: <code>nonMutatingSort(globalArray)</code> should not be hard coded.
|
||||
testString: assert(!nonMutatingSort.toString().match(/[23569]/g));
|
||||
testString: assert(!nonMutatingSort.toString().match(/[23569]/g));
|
||||
- text: The function should return a new array, not the array passed to it.
|
||||
testString: assert(nonMutatingSort(globalArray) !== globalArray);
|
||||
|
||||
```
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user