fix: make frankenSplice tests more robust (#38225)
This commit is contained in:
committed by
GitHub
parent
493060ef07
commit
f84173866a
@ -34,9 +34,9 @@ tests:
|
|||||||
- text: All elements from the first array should be added to the second array in their original order.
|
- text: All elements from the first array should be added to the second array in their original order.
|
||||||
testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]);
|
testString: assert.deepEqual(frankenSplice([1, 2, 3, 4], [], 0), [1, 2, 3, 4]);
|
||||||
- text: The first array should remain the same after the function runs.
|
- text: The first array should remain the same after the function runs.
|
||||||
testString: assert(testArr1[0] === 1 && testArr1[1] === 2);
|
testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr1, [1, 2]);
|
||||||
- text: The second array should remain the same after the function runs.
|
- text: The second array should remain the same after the function runs.
|
||||||
testString: assert(testArr2[0] === "a" && testArr2[1] === "b");
|
testString: frankenSplice(testArr1, testArr2); assert.deepEqual(testArr2, ["a", "b"]);
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user