Closed wichert closed 4 years ago
The tests all had a setup process that looks like this:
const {context} = require('@xmpp/test')
test.beforeEach(t => {
t.context = context()
t.context.middleware = _middleware(t.context)
t.context.iqCaller = _iqCaller(t.context)
t.context.plugin = setupPubsub(t.context)
})
I can get the tests working again by replacing context()
with mockClient()
:
const {mockClient} = require('@xmpp/test')
test.beforeEach(t => {
t.context = mockClient()
t.context.middleware = _middleware(t.context)
t.context.iqCaller = _iqCaller(t.context)
t.context.plugin = setupPubsub(t.context)
})
Is that the correct fix? There is no documentation for @xmpp/test so I'm not exactly sure what the right approach is.
from which version did you upgrade?
Is that the correct fix?
If it works, yes :D (also that's what xmpp.js
uses now so go ahead)
There is no documentation for @xmpp/test so I'm not exactly sure what the right approach is.
@xmpp/test
is kinda internal/private to xmpp.js
that's why it's not documented. happy to change after the 1.0
release though.
It does indeed work.
BTW, you may be happy to hear that Crypho is now running with xmppjs from npm in production; we switched away from our fork last week.
@wichert nice! \o/
I get a lot of test failures now, all looking something like this:
To reproduce you can checkout xmpp-plugins and run
make test-ci