fix(curriculum): remove before/after-user-code in es6 block (#66487)

This commit is contained in:
Sem Bauke
2026-03-16 10:11:03 +01:00
committed by GitHub
parent 20bedadd40
commit b68af56d7d
2 changed files with 16 additions and 16 deletions
@@ -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