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:
@ -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--
|
||||
|
@ -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--
|
||||
|
Reference in New Issue
Block a user