fix(curriculum): remove callback thereby stripping js comments (#45133)

* fix: strip js comments

* fix: revert helper export, better test approach

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>

Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
Naomi Carrigan
2022-02-24 02:59:56 -08:00
committed by GitHub
parent 3552a04e32
commit 1c65d5d34a
2 changed files with 8 additions and 11 deletions

View File

@ -32,16 +32,14 @@ Change the code so that all variables are declared using `let` or `const`. Use `
`var` should not exist in your code.
```js
(getUserInput) => assert(!getUserInput('index').match(/var/g));
assert.notMatch(code, /var/g);
```
You should change `fCC` to all uppercase.
```js
(getUserInput) => {
assert(getUserInput('index').match(/(FCC)/));
assert(!getUserInput('index').match(/fCC/));
}
assert.match(code, /(FCC)/);
assert.notMatch(code, /(fCC)/);
```
`FCC` should be a constant variable declared with `const`.
@ -54,14 +52,13 @@ assert.match(code, /const\s+FCC/);
`fact` should be declared with `let`.
```js
(getUserInput) => assert(getUserInput('index').match(/(let fact)/g));
assert.match(code, /(let\s+fact)/g);
```
`console.log` should be changed to print the `FCC` and `fact` variables.
```js
(getUserInput) =>
assert(getUserInput('index').match(/console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g));
assert.match(code, /console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g);
```
# --seed--

View File

@ -42,19 +42,19 @@ Update the code so it only uses the `let` keyword.
`var` should not exist in the code.
```js
(getUserInput) => assert(!getUserInput('index').match(/var/g));
assert.notMatch(code, /var/g);
```
`catName` should be the string `Oliver`.
```js
assert(catName === 'Oliver');
assert.equal(catName, 'Oliver');
```
`catSound` should be the string `Meow!`
```js
assert(catSound === 'Meow!');
assert.equal(catSound, 'Meow!');
```
# --seed--