mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
test: socket.emit doesnt exist in tests
This commit is contained in:
@@ -172,7 +172,9 @@ User.exportUsersCSV = async function (socket) {
|
||||
setTimeout(async () => {
|
||||
try {
|
||||
await user.exportUsersCSV();
|
||||
socket.emit('event:export-users-csv');
|
||||
if (socket.emit) {
|
||||
socket.emit('event:export-users-csv');
|
||||
}
|
||||
const notifications = require('../../notifications');
|
||||
const n = await notifications.create({
|
||||
bodyShort: '[[notifications:users-csv-exported]]',
|
||||
@@ -182,7 +184,7 @@ User.exportUsersCSV = async function (socket) {
|
||||
});
|
||||
await notifications.push(n, [socket.uid]);
|
||||
} catch (err) {
|
||||
winston.error(err);
|
||||
winston.error(err.stack);
|
||||
}
|
||||
}, 0);
|
||||
};
|
||||
|
||||
@@ -253,7 +253,7 @@ Sockets.getCountInRoom = function (room) {
|
||||
};
|
||||
|
||||
Sockets.warnDeprecated = (socket, replacement) => {
|
||||
if (socket.previousEvents) {
|
||||
if (socket.previousEvents && socket.emit) {
|
||||
socket.emit('event:deprecated_call', {
|
||||
eventName: socket.previousEvents[socket.previousEvents.length - 1],
|
||||
replacement: replacement,
|
||||
|
||||
Reference in New Issue
Block a user