feat(client, learn): add helper functions for common validation operations (#38605)

Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
This commit is contained in:
Hassaan Pasha
2020-09-17 19:08:01 +05:00
committed by GitHub
parent aecbc28798
commit 80438cac3e
54 changed files with 326 additions and 157 deletions

View File

@ -28,9 +28,9 @@ First, use <code>console.log</code> to log the <code>output</code> variable. The
```yml
tests:
- text: You should use <code>console.clear()</code> to clear the browser console.
testString: const removeJSComments = code.replace(/\/\*[\s\S]*?\*\/|\/\/.*$/gm, ''); const noSpaces = removeJSComments.replace(/\s/g, ''); assert(noSpaces.match(/console.clear\(\)/));
testString: assert(__helpers.removeWhiteSpace(__helpers.removeJSComments(code)).match(/console.clear\(\)/));
- text: You should use <code>console.log()</code> to print the <code>output</code> variable.
testString: const noSpaces = code.replace(/\s/g, ''); assert(noSpaces.match(/console\.log\(output\)/));
testString: assert(__helpers.removeWhiteSpace(code).match(/console\.log\(output\)/));
```
@ -53,8 +53,6 @@ let output = "Get this to log once in the freeCodeCamp console and twice in the
</div>
</section>
## Solution