From c03beb3ca68e91759c92f41131259cc96d0de011 Mon Sep 17 00:00:00 2001 From: lucia montero Date: Sat, 14 Nov 2020 18:14:47 -0500 Subject: [PATCH] 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> --- .../sass/create-reusable-css-with-mixins.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/curriculum/challenges/english/03-front-end-libraries/sass/create-reusable-css-with-mixins.md b/curriculum/challenges/english/03-front-end-libraries/sass/create-reusable-css-with-mixins.md index 9ab70d91ca..dbb4659fd1 100644 --- a/curriculum/challenges/english/03-front-end-libraries/sass/create-reusable-css-with-mixins.md +++ b/curriculum/challenges/english/03-front-end-libraries/sass/create-reusable-css-with-mixins.md @@ -55,15 +55,15 @@ tests: - text: Your code should declare a mixin named border-radius which has a parameter named $radius. testString: assert(code.match(/@mixin\s+?border-radius\s*?\(\s*?\$radius\s*?\)\s*?{/gi)); - text: Your code should include the -webkit-border-radius vendor prefix that uses the $radius 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 -moz-border-radius vendor prefix that uses the $radius 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 -ms-border-radius vendor prefix that uses the $radius 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 border-radius rule that uses the $radius 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 border-radius mixin using the @include 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)); ```