This commit is contained in:
Adhiraj
2020-09-02 13:04:49 +05:30
parent 50d50e4ae9
commit 426dbc255d
8 changed files with 2155 additions and 2658 deletions

View File

@@ -43,6 +43,7 @@ describe('Test Connect', () => {
it('should reconnect', async () => {
const conn = new WAConnection()
conn.connectOptions.timeoutMs = 20*1000
await conn
.loadAuthInfo (auth)
.connect ()
@@ -96,6 +97,7 @@ describe('Test Connect', () => {
})
describe ('Reconnects', () => {
const verifyConnectionOpen = async (conn: WAConnection) => {
assert.ok (conn.user.jid)
// check that the connection stays open
conn.on ('close', ({reason}) => (
reason !== DisconnectReason.intentional && assert.fail ('should not have closed again')