Fix tests to allow spaces in "Sass: Create Reusable CSS with Mixins" (#40230)

* Fix tests to allow spaces. Closes #40212

* Apply suggestions from code review

Remove redundant whitespace from regex

Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>

Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com>
This commit is contained in:
lucia montero 2020-11-14 18:14:47 -05:00 committed by GitHub
parent 1ef49d2c57
commit c03beb3ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -55,15 +55,15 @@ tests:
- text: Your code should declare a mixin named <code>border-radius</code> which has a parameter named <code>$radius</code>.
testString: assert(code.match(/@mixin\s+?border-radius\s*?\(\s*?\$radius\s*?\)\s*?{/gi));
- text: Your code should include the <code>-webkit-border-radius</code> vendor prefix that uses the <code>$radius</code> parameter.
testString: assert(code.match(/-webkit-border-radius:\s*?\$radius;/gi));
testString: assert(__helpers.removeWhiteSpace(code).match(/-webkit-border-radius:\$radius;/gi));
- text: Your code should include the <code>-moz-border-radius</code> vendor prefix that uses the <code>$radius</code> parameter.
testString: assert(code.match(/-moz-border-radius:\s*?\$radius;/gi));
testString: assert(__helpers.removeWhiteSpace(code).match(/-moz-border-radius:\$radius;/gi));
- text: Your code should include the <code>-ms-border-radius</code> vendor prefix that uses the <code>$radius</code> parameter.
testString: assert(code.match(/-ms-border-radius:\s*?\$radius;/gi));
testString: assert(__helpers.removeWhiteSpace(code).match(/-ms-border-radius:\$radius;/gi));
- text: Your code should include the general <code>border-radius</code> rule that uses the <code>$radius</code> parameter.
testString: assert(code.match(/border-radius:\s*?\$radius;/gi).length == 4);
testString: assert(__helpers.removeWhiteSpace(code).match(/border-radius:\$radius;/gi).length == 4);
- text: Your code should call the <code>border-radius mixin</code> using the <code>@include</code> keyword, setting it to 15px.
testString: assert(code.match(/@include\s+?border-radius\(\s*?15px\s*?\);/gi));
testString: assert(code.match(/@include\s+?border-radius\(\s*?15px\s*?\)\s*;/gi));
```