fix(client): remove JS comments from user code for tests (#41873)
* Removes comments in js challanges by default * fix local-scope-and-functions test regex * fix all languages * revert language changes * removed unnecessary removeJSComments from challenges * fix challanges in other languages * removed removeJSComments from all challanges
This commit is contained in:
committed by
GitHub
parent
ebe8f99345
commit
db369fbed1
@ -28,7 +28,7 @@ assert.typeOf(squareList, 'function'),
|
||||
不应该使用 `for`、`while` 或者 `forEach`。
|
||||
|
||||
```js
|
||||
assert(!__helpers.removeJSComments(code).match(/for|while|forEach/g));
|
||||
assert(!code.match(/for|while|forEach/g));
|
||||
```
|
||||
|
||||
应该使用 `map`、`filter` 或者 `reduce`。
|
||||
@ -36,7 +36,7 @@ assert(!__helpers.removeJSComments(code).match(/for|while|forEach/g));
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
.removeWhiteSpace(code)
|
||||
.match(/\.(map|filter|reduce)\(/g)
|
||||
);
|
||||
```
|
||||
|
@ -52,7 +52,7 @@ assert(
|
||||
不能使用 `for` 循环。
|
||||
|
||||
```js
|
||||
assert(!__helpers.removeJSComments(code).match(/for\s*?\([\s\S]*?\)/));
|
||||
assert(!code.match(/for\s*?\([\s\S]*?\)/));
|
||||
```
|
||||
|
||||
你的代码应使用 `map` 方法。
|
||||
|
Reference in New Issue
Block a user