mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): make concatenation optional (#62232)
This commit is contained in:
+3
-2
@@ -100,10 +100,11 @@ You should give `codingFact` a value that includes `favoriteLanguage`.
|
||||
```js
|
||||
const codeWithoutComments = __helpers.removeJSComments(code);
|
||||
assert.match(code, /let\s+codingFact/);
|
||||
assert.match(code, /codingFact\s*=\s*(("|'|`)?.+?\1?\s*\+\s*|favoriteLanguage\s*\+\s*(("|'|`)?.+?\3?))/);
|
||||
assert.match(code, /codingFact\s*=\s*(("|'|`)?.+?\1?\s*\+?\s*|favoriteLanguage\s*\+\s*(("|'|`)?.+?\3?))/);
|
||||
assert.exists(codingFact);
|
||||
assert.isNotEmpty(codingFact);
|
||||
assert.include(String(codingFact), favoriteLanguage);
|
||||
assert.include(getLogs()[3], favoriteLanguage);
|
||||
```
|
||||
|
||||
You should log `codingFact` to the console.
|
||||
@@ -120,7 +121,7 @@ You should assign a new value to `codingFact` that also contains `favoriteLangua
|
||||
```js
|
||||
const codeWithoutComments = __helpers.removeJSComments(code);
|
||||
const loggingCodingFacts = codeWithoutComments.match(/console\.log\(\s*codingFact\s*\)/g)
|
||||
const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*(("|')?.+?\2?\s*\+\s*|favoriteLanguage\s*\+\s*(("|')?.+?\2?))/g);
|
||||
const [first, second, third] = codeWithoutComments.match(/(let )?\s*codingFact\s*=\s*(("|')?.+?\2?\s*\+?\s*|favoriteLanguage\s*\+\s*(("|')?.+?\2?))/g);
|
||||
assert.include(getLogs()[4], favoriteLanguage);
|
||||
assert.notEqual(getLogs()[4], getLogs()[3]);
|
||||
assert.isAtLeast(loggingCodingFacts.length, 2);
|
||||
|
||||
Reference in New Issue
Block a user