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
This commit is contained in:
Relsig
2020-03-26 08:09:34 -05:00
committed by GitHub
parent c830951beb
commit bb7a50e341

View File

@ -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); })
```