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
@ -32,11 +32,9 @@ Haz una función promesa que maneje el éxito y el fallo. Si `responseFromServer
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeJSComments(code)
|
||||
.match(
|
||||
code.match(
|
||||
/if\s*\(\s*responseFromServer\s*\)\s*{\s*resolve\s*\(\s*('|"|`)We got the data\1\s*\)(\s*|\s*;\s*)}/g
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
@ -44,11 +42,9 @@ assert(
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeJSComments(code)
|
||||
.match(
|
||||
code.match(
|
||||
/}\s*else\s*{\s*reject\s*\(\s*('|"|`)Data not received\1\s*\)(\s*|\s*;\s*)}/g
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
|
@ -43,9 +43,7 @@ Debes eliminar la sintaxis de asignación ES5.
|
||||
|
||||
```js
|
||||
assert(
|
||||
!__helpers
|
||||
.removeJSComments(code)
|
||||
.match(/today\s*=\s*HIGH_TEMPERATURES\.(today|tomorrow)/g)
|
||||
!code.match(/today\s*=\s*HIGH_TEMPERATURES\.(today|tomorrow)/g)
|
||||
);
|
||||
```
|
||||
|
||||
@ -53,11 +51,9 @@ Debes usar desestructuración para crear la variable `today`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeJSComments(code)
|
||||
.match(
|
||||
code.match(
|
||||
/(var|let|const)\s*{\s*(today[^}]*|[^,]*,\s*today)\s*}\s*=\s*HIGH_TEMPERATURES(;|\s+|\/\/)/g
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
@ -65,11 +61,9 @@ Debes usar desestructuración para crear la variable `tomorrow`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
__helpers
|
||||
.removeJSComments(code)
|
||||
.match(
|
||||
code.match(
|
||||
/(var|let|const)\s*{\s*(tomorrow[^}]*|[^,]*,\s*tomorrow)\s*}\s*=\s*HIGH_TEMPERATURES(;|\s+|\/\/)/g
|
||||
)
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
|
@ -39,7 +39,7 @@ Refactoriza la función `setGear` dentro del objeto `bicycle` para que utilice l
|
||||
La expresión tradicional "function" no debe ser utilizada.
|
||||
|
||||
```js
|
||||
(getUserInput) => assert(!__helpers.removeJSComments(code).match(/function/));
|
||||
(getUserInput) => assert(!code.match(/function/));
|
||||
```
|
||||
|
||||
`setGear` debe ser una función declarativa.
|
||||
|
Reference in New Issue
Block a user