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.
|
`var` should not exist in your code.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
(getUserInput) => assert(!getUserInput('index').match(/var/g));
|
assert.notMatch(code, /var/g);
|
||||||
```
|
```
|
||||||
|
|
||||||
You should change `fCC` to all uppercase.
|
You should change `fCC` to all uppercase.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
(getUserInput) => {
|
assert.match(code, /(FCC)/);
|
||||||
assert(getUserInput('index').match(/(FCC)/));
|
assert.notMatch(code, /(fCC)/);
|
||||||
assert(!getUserInput('index').match(/fCC/));
|
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
`FCC` should be a constant variable declared with `const`.
|
`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`.
|
`fact` should be declared with `let`.
|
||||||
|
|
||||||
```js
|
```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.
|
`console.log` should be changed to print the `FCC` and `fact` variables.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
(getUserInput) =>
|
assert.match(code, /console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g);
|
||||||
assert(getUserInput('index').match(/console\.log\(\s*FCC\s*\,\s*fact\s*\)\s*;?/g));
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# --seed--
|
# --seed--
|
||||||
|
@ -42,19 +42,19 @@ Update the code so it only uses the `let` keyword.
|
|||||||
`var` should not exist in the code.
|
`var` should not exist in the code.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
(getUserInput) => assert(!getUserInput('index').match(/var/g));
|
assert.notMatch(code, /var/g);
|
||||||
```
|
```
|
||||||
|
|
||||||
`catName` should be the string `Oliver`.
|
`catName` should be the string `Oliver`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(catName === 'Oliver');
|
assert.equal(catName, 'Oliver');
|
||||||
```
|
```
|
||||||
|
|
||||||
`catSound` should be the string `Meow!`
|
`catSound` should be the string `Meow!`
|
||||||
|
|
||||||
```js
|
```js
|
||||||
assert(catSound === 'Meow!');
|
assert.equal(catSound, 'Meow!');
|
||||||
```
|
```
|
||||||
|
|
||||||
# --seed--
|
# --seed--
|
||||||
|
Reference in New Issue
Block a user