mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): remove before/after-user-code in es6 block (#66487)
This commit is contained in:
@@ -41,14 +41,20 @@ assert(
|
||||
Your `then` method should have a callback function with `result` as its parameter.
|
||||
|
||||
```js
|
||||
assert(resultIsParameter);
|
||||
assert(
|
||||
/\.then\((function\(result\){|result|\(result\)=>)/.test(
|
||||
__helpers.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
You should log `result` to the console.
|
||||
|
||||
```js
|
||||
assert(
|
||||
resultIsParameter &&
|
||||
/\.then\((function\(result\){|result|\(result\)=>)/.test(
|
||||
__helpers.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
) &&
|
||||
__helpers
|
||||
.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
.match(/\.then\(.*?result.*?console.log\(result\).*?\)/)
|
||||
@@ -57,12 +63,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```js
|
||||
const resultIsParameter = /\.then\((function\(result\){|result|\(result\)=>)/.test(__helpers.removeWhiteSpace(__helpers.removeJSComments(code)));
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
|
||||
@@ -35,14 +35,20 @@ assert(
|
||||
Your `catch` method should have a callback function with `error` as its parameter.
|
||||
|
||||
```js
|
||||
assert(errorIsParameter);
|
||||
assert(
|
||||
/\.catch\((function\(error\){|error|\(error\)=>)/.test(
|
||||
__helpers.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
)
|
||||
);
|
||||
```
|
||||
|
||||
You should log `error` to the console.
|
||||
|
||||
```js
|
||||
assert(
|
||||
errorIsParameter &&
|
||||
/\.catch\((function\(error\){|error|\(error\)=>)/.test(
|
||||
__helpers.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
) &&
|
||||
__helpers
|
||||
.removeWhiteSpace(__helpers.removeJSComments(code))
|
||||
.match(/\.catch\(.*?error.*?console.log\(error\).*?\)/)
|
||||
@@ -51,12 +57,6 @@ assert(
|
||||
|
||||
# --seed--
|
||||
|
||||
## --after-user-code--
|
||||
|
||||
```js
|
||||
const errorIsParameter = /\.catch\((function\(error\){|error|\(error\)=>)/.test(__helpers.removeWhiteSpace(__helpers.removeJSComments(code)));
|
||||
```
|
||||
|
||||
## --seed-contents--
|
||||
|
||||
```js
|
||||
|
||||
Reference in New Issue
Block a user