xmppjs / xmpp.js

XMPP for JavaScript
ISC License
2.18k stars 371 forks source link

stream-management: await the enable stanza #962

Closed moufmouf closed 1 year ago

moufmouf commented 1 year ago

Trying to await the sending of an "enable" stanza to fix a "Uncaught exception" (see #961).

The attempt is currently failing because I'm kind of a newbie regarding Ava and the testing framework.

I tried to write a test with a client that rejects the "send", but could not really manage to have that working. I'm not 100% sure if I'm mocking the client correctly, nor if the error is supposed to be triggered by the "tick" function actually. I'm also not sure I'm using t.throwsAsync correctly.

Also, adding the "await" keyword to "entity.send" is triggering other tests to fail.

Any pointer/idea/suggestion would be warmly welcome :pray:

sonnyp commented 1 year ago

@moufmouf sorry for the delay – I had to do some maintenance work first.

I have finished your PR and fixed the tests.

Thanks!