diff --git a/curriculum/challenges/english/blocks/es6/5cdafbd72913098997531681.md b/curriculum/challenges/english/blocks/es6/5cdafbd72913098997531681.md index adce955322d..cfcc4af8503 100644 --- a/curriculum/challenges/english/blocks/es6/5cdafbd72913098997531681.md +++ b/curriculum/challenges/english/blocks/es6/5cdafbd72913098997531681.md @@ -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 diff --git a/curriculum/challenges/english/blocks/es6/5cdafbe72913098997531682.md b/curriculum/challenges/english/blocks/es6/5cdafbe72913098997531682.md index 51a210f88d8..736d88342e2 100644 --- a/curriculum/challenges/english/blocks/es6/5cdafbe72913098997531682.md +++ b/curriculum/challenges/english/blocks/es6/5cdafbe72913098997531682.md @@ -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