mirror of
https://github.com/Koenkk/zigbee2mqtt.git
synced 2026-07-17 00:51:55 +00:00
Another attempt to fix https://github.com/Koenkk/zigbee2mqtt/issues/9822
This commit is contained in:
+2
-1
@@ -69,7 +69,8 @@ export default class MQTT {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
this.client = mqtt.connect(mqttSettings.server, options);
|
||||
this.client.setMaxListeners(0);
|
||||
// @ts-ignore https://github.com/Koenkk/zigbee2mqtt/issues/9822
|
||||
this.client.stream.setMaxListeners(0);
|
||||
|
||||
const onConnect = this.onConnect;
|
||||
this.client.on('connect', async () => {
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ const mock = {
|
||||
subscribe: jest.fn(),
|
||||
reconnecting: false,
|
||||
on: jest.fn(),
|
||||
setMaxListeners: jest.fn(),
|
||||
stream: {setMaxListeners: jest.fn()}
|
||||
};
|
||||
|
||||
const mockConnect = jest.fn().mockReturnValue(mock);
|
||||
|
||||
Reference in New Issue
Block a user