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:
Randell Dawson 2020-02-24 06:30:48 -08:00 committed by GitHub
parent 5b80595fbf
commit 78156a65f0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);
```