From bb7a50e3417e13e1eec3efb9a69176e49de8b164 Mon Sep 17 00:00:00 2001 From: Relsig Date: Thu, 26 Mar 2020 08:09:34 -0500 Subject: [PATCH] Enable newlines in Authentication with Socket.IO, test 3 (#37862) * newlines in Authentication with Socket.IO, test 3 Both my original formatting and glitch's "format this file" button add a newline between "io.use(" and "passport.authorize" ".+" catches one or more of anything that isn't a newline. "[^]+" catches one or more of anything including newlines. This change updates the test accordingly so people who use glitch's formatting don't get left searching for assistance * less permissive match to prevent shenanigans Won't work with comments still. * fix my own silliness --- .../authentication-with-socket.io.english.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/authentication-with-socket.io.english.md b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/authentication-with-socket.io.english.md index 04e4476ba7..f3bdfe8ab8 100644 --- a/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/authentication-with-socket.io.english.md +++ b/curriculum/challenges/english/06-information-security-and-quality-assurance/advanced-node-and-express/authentication-with-socket.io.english.md @@ -41,7 +41,7 @@ tests: - text: passportSocketIo should be properly required. testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js').then(data => { assert.match(data, /require\((['"])passport\.socketio\1\)/gi, 'You should correctly require and instantiate "passport.socketio"');}, xhr => { throw new Error(xhr.statusText); }) - text: passportSocketIo should be properly setup. - testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /io\.use\(.+\.authorize\(/gi, 'You should register "passport.socketio" as socket.io middleware and provide it correct options'); }, xhr => { throw new Error(xhr.statusText); }) + testString: getUserInput => $.get(getUserInput('url')+ '/_api/server.js') .then(data => { assert.match(data, /io\.use\(\s*\w+\.authorize\(/, 'You should register "passport.socketio" as socket.io middleware and provide it correct options'); }, xhr => { throw new Error(xhr.statusText); }) ```