From 6630b2be7a02c5568fb37ce7894398823922db34 Mon Sep 17 00:00:00 2001
From: RIHANE ZAKARIA <26233784+sil3nthill@users.noreply.github.com>
Date: Wed, 1 May 2019 01:37:27 +0200
Subject: [PATCH] bug fix / test of Spread Operator javascript challenge /
english (#35856)
* bug fix test with the Spread Operator
* test of Spread Operator javascript challenge / english / change test and add a helper function
---
...-array-with-the-spread-operator.english.md | 29 +++++++++++++++----
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.english.md b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.english.md
index 0fb2c32cc7..4dc22dca24 100644
--- a/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.english.md
+++ b/curriculum/challenges/english/02-javascript-algorithms-and-data-structures/basic-data-structures/copy-an-array-with-the-spread-operator.english.md
@@ -22,15 +22,15 @@ We have defined a function, copyMachine
which takes arr
copyMachine([true, false, true], 2) should return [[true, false, true], [true, false, true]]
- testString: assert.deepEqual(copyMachine([true, false, true], 2), [[true, false, true], [true, false, true]], 'copyMachine([true, false, true], 2)
should return [[true, false, true], [true, false, true]]
');
+ testString: assert.deepEqual(copyMachine([true, false, true], 2), [[true, false, true], [true, false, true]]);
- text: copyMachine([1, 2, 3], 5)
should return [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]
- testString: assert.deepEqual(copyMachine([1, 2, 3], 5), [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]], 'copyMachine([1, 2, 3], 5)
should return [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]
');
+ testString: assert.deepEqual(copyMachine([1, 2, 3], 5), [[1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3], [1, 2, 3]]);
- text: copyMachine([true, true, null], 1)
should return [[true, true, null]]
- testString: assert.deepEqual(copyMachine([true, true, null], 1), [[true, true, null]], 'copyMachine([true, true, null], 1)
should return [[true, true, null]]
');
+ testString: assert.deepEqual(copyMachine([true, true, null], 1), [[true, true, null]]);
- text: copyMachine(["it works"], 3)
should return [["it works"], ["it works"], ["it works"]]
- testString: assert.deepEqual(copyMachine(['it works'], 3), [['it works'], ['it works'], ['it works']], 'copyMachine(["it works"], 3)
should return [["it works"], ["it works"], ["it works"]]
');
+ testString: assert.deepEqual(copyMachine(['it works'], 3), [['it works'], ['it works'], ['it works']]);
- text: The copyMachine
function should utilize the spread operator
with array arr
- testString: assert.notStrictEqual(copyMachine.toString().indexOf('.concat(_toConsumableArray(arr))'), -1, 'The copyMachine
function should utilize the spread operator
with array arr
');
+ testString: assert(removeJSComments(code).match(/\.\.\.arr/));
```
@@ -59,7 +59,14 @@ console.log(copyMachine([true, false, true], 2));
+### After Test
+