mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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 () => {
|
setTimeout(async () => {
|
||||||
try {
|
try {
|
||||||
await user.exportUsersCSV();
|
await user.exportUsersCSV();
|
||||||
|
if (socket.emit) {
|
||||||
socket.emit('event:export-users-csv');
|
socket.emit('event:export-users-csv');
|
||||||
|
}
|
||||||
const notifications = require('../../notifications');
|
const notifications = require('../../notifications');
|
||||||
const n = await notifications.create({
|
const n = await notifications.create({
|
||||||
bodyShort: '[[notifications:users-csv-exported]]',
|
bodyShort: '[[notifications:users-csv-exported]]',
|
||||||
@@ -182,7 +184,7 @@ User.exportUsersCSV = async function (socket) {
|
|||||||
});
|
});
|
||||||
await notifications.push(n, [socket.uid]);
|
await notifications.push(n, [socket.uid]);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
winston.error(err);
|
winston.error(err.stack);
|
||||||
}
|
}
|
||||||
}, 0);
|
}, 0);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -253,7 +253,7 @@ Sockets.getCountInRoom = function (room) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
Sockets.warnDeprecated = (socket, replacement) => {
|
Sockets.warnDeprecated = (socket, replacement) => {
|
||||||
if (socket.previousEvents) {
|
if (socket.previousEvents && socket.emit) {
|
||||||
socket.emit('event:deprecated_call', {
|
socket.emit('event:deprecated_call', {
|
||||||
eventName: socket.previousEvents[socket.previousEvents.length - 1],
|
eventName: socket.previousEvents[socket.previousEvents.length - 1],
|
||||||
replacement: replacement,
|
replacement: replacement,
|
||||||
|
|||||||
Reference in New Issue
Block a user