 jest.spyOn(heartBeat, 'monitorDisconnect');             mock.get(/.*/, {               status: errorCode,               headers: { 'Content-Type': 'application/json' },             });             return heartBeat._checkSession().finally(() => {               expect(