mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 07:56:16 -04:00
tests: Rename getSocketEvent()
to waitForSocketEvent()
This commit is contained in:
parent
65bd597053
commit
3132235f2c
1 changed files with 3 additions and 3 deletions
|
@ -79,7 +79,7 @@ exports.init = async function () {
|
||||||
* @param {string} event - The socket.io Socket event to listen for.
|
* @param {string} event - The socket.io Socket event to listen for.
|
||||||
* @returns The argument(s) passed to the event handler.
|
* @returns The argument(s) passed to the event handler.
|
||||||
*/
|
*/
|
||||||
exports.getSocketEvent = async (socket, event) => {
|
exports.waitForSocketEvent = async (socket, event) => {
|
||||||
const errorEvents = [
|
const errorEvents = [
|
||||||
'error',
|
'error',
|
||||||
'connect_error',
|
'connect_error',
|
||||||
|
@ -137,7 +137,7 @@ exports.connect = async (res = null) => {
|
||||||
query: {cookie: reqCookieHdr, padId},
|
query: {cookie: reqCookieHdr, padId},
|
||||||
});
|
});
|
||||||
try {
|
try {
|
||||||
await exports.getSocketEvent(socket, 'connect');
|
await exports.waitForSocketEvent(socket, 'connect');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
socket.close();
|
socket.close();
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -164,7 +164,7 @@ exports.handshake = async (socket, padId) => {
|
||||||
token: 't.12345',
|
token: 't.12345',
|
||||||
});
|
});
|
||||||
logger.debug('waiting for CLIENT_VARS response...');
|
logger.debug('waiting for CLIENT_VARS response...');
|
||||||
const msg = await exports.getSocketEvent(socket, 'message');
|
const msg = await exports.waitForSocketEvent(socket, 'message');
|
||||||
logger.debug('received CLIENT_VARS message');
|
logger.debug('received CLIENT_VARS message');
|
||||||
return msg;
|
return msg;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue