describe('When connecting to my notification socket', function () {
it('Should fail with no token', function (next) {
- const socket = io(`http://localhost:${server.port}/user-notifications`, { reconnection: false })
+ const socket = io(`${server.url}/user-notifications`, { reconnection: false })
socket.once('connect_error', function () {
socket.disconnect()
})
it('Should fail with an invalid token', function (next) {
- const socket = io(`http://localhost:${server.port}/user-notifications`, {
+ const socket = io(`${server.url}/user-notifications`, {
query: { accessToken: 'bad_access_token' },
reconnection: false
})
})
it('Should success with the correct token', function (next) {
- const socket = io(`http://localhost:${server.port}/user-notifications`, {
+ const socket = io(`${server.url}/user-notifications`, {
query: { accessToken: server.accessToken },
reconnection: false
})