diff --git a/curriculum/challenges/english/25-front-end-development/lab-sentence-maker/66c057041df6394ca796bf33.md b/curriculum/challenges/english/25-front-end-development/lab-sentence-maker/66c057041df6394ca796bf33.md index 24291f7845f..1f956cf2c72 100644 --- a/curriculum/challenges/english/25-front-end-development/lab-sentence-maker/66c057041df6394ca796bf33.md +++ b/curriculum/challenges/english/25-front-end-development/lab-sentence-maker/66c057041df6394ca796bf33.md @@ -119,11 +119,18 @@ You should declare a `firstStory` variable. assert.isNotNull(firstStory); ``` -Your should use the correct story format for both stories: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`. Pay attention to spaces. +You should use the correct story format for the first story: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`. Pay attention to spaces. ```js -const expected = `Once upon a time, there was a(n) ${adjective} ${noun} who loved to eat ${noun2}. The ${noun} lived in a ${place} and had ${adjective2} nostrils that blew fire when it was ${verb}.`; -assert.strictEqual(secondStory, expected); +const _initialValues = {} +for (const name of ['adjective', 'noun', 'noun2', 'place', 'verb', 'adjective2']) { + const match = code.match(new RegExp(String.raw`${name}\s*=\s*('|"|${'`'})(?<${name}>.*)\1;?\s*`)); + _initialValues[name] = match ? match.groups[name] : null; +} + +const expected = `Once upon a time, there was a(n) ${_initialValues['adjective']} ${_initialValues['noun']} who loved to eat ${_initialValues['noun2']}. The ${_initialValues['noun']} lived in a ${_initialValues['place']} and had ${_initialValues['adjective2']} nostrils that blew fire when it was ${_initialValues['verb']}.`; + +assert.strictEqual(firstStory, expected); ``` You should log your first story using the message `"First story: [firstStory]"`. @@ -176,6 +183,13 @@ You should reassign the `noun2` variable for the second story. assert.lengthOf(__helpers.removeJSComments(code).match(/noun2\s*=\s*/g), 2); ``` +You should use the correct story format for the second story: `"Once upon a time, there was a(n) [adjective] [noun] who loved to eat [noun2]. The [noun] lived in a [place] and had [adjective2] nostrils that blew fire when it was [verb]."`. Pay attention to spaces. + +```js +const expected = `Once upon a time, there was a(n) ${adjective} ${noun} who loved to eat ${noun2}. The ${noun} lived in a ${place} and had ${adjective2} nostrils that blew fire when it was ${verb}.`; +assert.strictEqual(secondStory, expected); +``` + You should log your second story using the format `"Second story: [secondStory]"`. ```js