From fbbf7e3f75618a0f8c1780cf6c8ab5c9c6275aed Mon Sep 17 00:00:00 2001 From: piouson Date: Tue, 8 Sep 2020 17:55:20 +0100 Subject: [PATCH] Fix tests failing due to whitespaces and trailing forward slash in Advanced Node and Express (#39534) * Fix implementation-of-social-authentication.english.md Resolve #39533 * Update implementation-of-social-authentication.english.md - added capture groups - updated whitespace filter, `/[\s\r\n]/g` -> `/\s/g` * Update curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.english.md Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> * Update implementation-of-social-authentication.english.md Co-authored-by: Shaun Hamilton <51722130+Sky020@users.noreply.github.com> --- .../implementation-of-social-authentication.english.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.english.md b/curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.english.md index 16713bce82..a17e265cb4 100644 --- a/curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.english.md +++ b/curriculum/challenges/english/06-quality-assurance/advanced-node-and-express/implementation-of-social-authentication.english.md @@ -40,9 +40,9 @@ Submit your page when you think you've got it right. If you're running into erro ```yml tests: - text: Route /auth/github should be correct. - testString: getUserInput => $.get(getUserInput('url')+ '/_api/routes.js') .then(data => { assert.match(data, /('|")\/auth\/github('|")[^]*get.*passport.authenticate.*github/gi, 'Route auth/github should only call passport.authenticate with github'); }, xhr => { throw new Error(xhr.statusText); }) + testString: getUserInput => $.get(getUserInput('url')+ '/_api/routes.js') .then(data => { assert.match(data.replace(/\s/g,""), /('|")\/auth\/github\/?\1[^]*?get.*?passport.authenticate.*?github/gi, 'Route auth/github should only call passport.authenticate with github'); }, xhr => { throw new Error(xhr.statusText); }) - text: Route /auth/github/callback should be correct. - testString: getUserInput => $.get(getUserInput('url')+ '/_api/routes.js') .then(data => { assert.match(data, /('|")\/auth\/github\/callback('|")[^]*get.*passport.authenticate.*github.*failureRedirect:( |)("|')\/\2/gi, 'Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home'); }, xhr => { throw new Error(xhr.statusText); }) + testString: getUserInput => $.get(getUserInput('url')+ '/_api/routes.js') .then(data => { assert.match(data.replace(/\s/g,""), /('|")\/auth\/github\/callback\/?\1[^]*?get.*?passport.authenticate.*?github.*?failureRedirect:("|')\/\2/gi, 'Route auth/github/callback should accept a get request and call passport.authenticate for github with a failure redirect to home'); }, xhr => { throw new Error(xhr.statusText); }) ```