fix(curriculum): added test to allow any order solution (#38771)

* added test to allow any order solution

* add removeJSComments for tests
This commit is contained in:
Shaun Hamilton
2020-05-18 15:02:03 +01:00
committed by GitHub
parent 51f0d703f1
commit 9ad4c98ecb

View File

@ -39,7 +39,9 @@ tests:
- text: <code>substringDivisibility()</code> should return an array.
testString: assert(Array.isArray(substringDivisibility()));
- text: <code>substringDivisibility()</code> should return [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ].
testString: assert.deepEqual(substringDivisibility(), [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ]);
testString: assert.sameMembers(substringDivisibility(), [ 1430952867, 1460357289, 1406357289, 4130952867, 4160357289, 4106357289 ]);
- text: You should not copy and return the array.
testString: assert(!removeJSComments(code).match(/(1430952867)|(1460357289)|(1406357289)|(4130952867)|(4160357289)|(4106357289)/))
```
@ -61,7 +63,14 @@ substringDivisibility();
</div>
### After Test
<div id='js-teardown'>
```js
const removeJSComments = str => str.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, '');
```
</div>
</section>