Commit 877e0777 authored by JC Brand's avatar JC Brand

Remove need to pass in spies to `initConverse`

They aren't used anymore.
parent 9d77a4ef
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
it("shows all autocompletion options when the user presses @", it("shows all autocompletion options when the user presses @",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'tom'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'tom');
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
it("autocompletes when the user presses tab", it("autocompletes when the user presses tab",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
...@@ -166,7 +166,7 @@ ...@@ -166,7 +166,7 @@
it("autocompletes when the user presses backspace", it("autocompletes when the user presses backspace",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
describe("A chat room", function () { describe("A chat room", function () {
it("can be bookmarked", mock.initConverse( it("can be bookmarked", mock.initConverse(
null, ['rosterGroupsFetched', 'emojisInitialized'], {}, ['rosterGroupsFetched', 'emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
it("will be automatically opened if 'autojoin' is set on the bookmark", mock.initConverse( it("will be automatically opened if 'autojoin' is set on the bookmark", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
describe("when bookmarked", function () { describe("when bookmarked", function () {
it("will use the nickname from the bookmark", mock.initConverse( it("will use the nickname from the bookmark", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -211,7 +211,7 @@ ...@@ -211,7 +211,7 @@
})); }));
it("displays that it's bookmarked through its bookmark icon", mock.initConverse( it("displays that it's bookmarked through its bookmark icon", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.waitUntilDiscoConfirmed( test_utils.waitUntilDiscoConfirmed(
...@@ -239,7 +239,7 @@ ...@@ -239,7 +239,7 @@
})); }));
it("can be unbookmarked", mock.initConverse( it("can be unbookmarked", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -317,7 +317,7 @@ ...@@ -317,7 +317,7 @@
describe("and when autojoin is set", function () { describe("and when autojoin is set", function () {
it("will be be opened and joined automatically upon login", mock.initConverse( it("will be be opened and joined automatically upon login", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilBookmarksReturned(_converse); await test_utils.waitUntilBookmarksReturned(_converse);
...@@ -346,7 +346,7 @@ ...@@ -346,7 +346,7 @@
describe("Bookmarks", function () { describe("Bookmarks", function () {
it("can be pushed from the XMPP server", mock.initConverse( it("can be pushed from the XMPP server", mock.initConverse(
['send'], ['rosterGroupsFetched', 'connected'], {}, ['rosterGroupsFetched', 'connected'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -404,7 +404,7 @@ ...@@ -404,7 +404,7 @@
it("can be retrieved from the XMPP server", mock.initConverse( it("can be retrieved from the XMPP server", mock.initConverse(
null, ['chatBoxesFetched', 'roomsPanelRendered', 'rosterGroupsFetched'], {}, ['chatBoxesFetched', 'roomsPanelRendered', 'rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -482,7 +482,7 @@ ...@@ -482,7 +482,7 @@
describe("The rooms panel", function () { describe("The rooms panel", function () {
it("shows a list of bookmarks", mock.initConverse( it("shows a list of bookmarks", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -558,7 +558,7 @@ ...@@ -558,7 +558,7 @@
it("remembers the toggle state of the bookmarks list", mock.initConverse( it("remembers the toggle state of the bookmarks list", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -614,7 +614,7 @@ ...@@ -614,7 +614,7 @@
describe("When hide_open_bookmarks is true and a bookmarked room is opened", function () { describe("When hide_open_bookmarks is true and a bookmarked room is opened", function () {
it("can be closed", mock.initConverse( it("can be closed", mock.initConverse(
null, ['rosterGroupsFetched'], ['rosterGroupsFetched'],
{ hide_open_bookmarks: true }, { hide_open_bookmarks: true },
async function (done, _converse) { async function (done, _converse) {
......
This diff is collapsed.
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
it("can be opened by clicking a DOM element with class 'toggle-controlbox'", it("can be opened by clicking a DOM element with class 'toggle-controlbox'",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
// This spec will only pass if the controlbox is not currently // This spec will only pass if the controlbox is not currently
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
it("can be used to add contact and it checks for case-sensivity", it("can be used to add contact and it checks for case-sensivity",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'emojisInitialized'], {}, ['rosterGroupsFetched', 'emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
spyOn(_converse.api, "trigger").and.callThrough(); spyOn(_converse.api, "trigger").and.callThrough();
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
it("shows the number of unread mentions received", it("shows the number of unread mentions received",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'all').openControlBox(); test_utils.createContacts(_converse, 'all').openControlBox();
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
it("shows the user's chat status, which is online by default", it("shows the user's chat status, which is online by default",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -128,7 +128,7 @@ ...@@ -128,7 +128,7 @@
it("can be used to set the current user's chat status", it("can be used to set the current user's chat status",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -157,7 +157,7 @@ ...@@ -157,7 +157,7 @@
it("can be used to set a custom status message", it("can be used to set a custom status message",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
it("opens up an add modal when you click on it", it("opens up an add modal when you click on it",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'all').openControlBox(); test_utils.createContacts(_converse, 'all').openControlBox();
...@@ -226,7 +226,7 @@ ...@@ -226,7 +226,7 @@
it("can be configured to not provide search suggestions", it("can be configured to not provide search suggestions",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {'autocomplete_add_contact': false}, ['rosterGroupsFetched'], {'autocomplete_add_contact': false},
async function (done, _converse) { async function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -257,7 +257,7 @@ ...@@ -257,7 +257,7 @@
it("integrates with xhr_user_search_url to search for contacts", it("integrates with xhr_user_search_url to search for contacts",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], ['rosterGroupsFetched'],
{ 'xhr_user_search_url': 'http://example.org/?' }, { 'xhr_user_search_url': 'http://example.org/?' },
async function (done, _converse) { async function (done, _converse) {
...@@ -314,7 +314,7 @@ ...@@ -314,7 +314,7 @@
it("can be configured to not provide search suggestions for XHR search results", it("can be configured to not provide search suggestions for XHR search results",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], ['rosterGroupsFetched'],
{ 'autocomplete_add_contact': false, { 'autocomplete_add_contact': false,
'xhr_user_search_url': 'http://example.org/?' }, 'xhr_user_search_url': 'http://example.org/?' },
async function (done, _converse) { async function (done, _converse) {
......
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
describe("A chat state indication", function () { describe("A chat state indication", function () {
it("are sent out when the client becomes or stops being idle", it("are sent out when the client becomes or stops being idle",
mock.initConverse(null, ['discoInitialized'], {}, (done, _converse) => { mock.initConverse(['discoInitialized'], {}, (done, _converse) => {
spyOn(_converse, 'sendCSI').and.callThrough(); spyOn(_converse, 'sendCSI').and.callThrough();
let sent_stanza; let sent_stanza;
...@@ -215,7 +215,7 @@ ...@@ -215,7 +215,7 @@
it("has a method 'get' which returns wrapped contacts", it("has a method 'get' which returns wrapped contacts",
mock.initConverse( mock.initConverse(
null, ['emojisInitialized'], {}, ['emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -253,7 +253,7 @@ ...@@ -253,7 +253,7 @@
describe("The \"chats\" API", function() { describe("The \"chats\" API", function() {
it("has a method 'get' which returns the promise that resolves to a chat model", mock.initConverse( it("has a method 'get' which returns the promise that resolves to a chat model", mock.initConverse(
null, ['rosterInitialized', 'chatBoxesInitialized'], {}, ['rosterInitialized', 'chatBoxesInitialized'], {},
async (done, _converse) => { async (done, _converse) => {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -289,7 +289,7 @@ ...@@ -289,7 +289,7 @@
})); }));
it("has a method 'open' which opens and returns a promise that resolves to a chat model", mock.initConverse( it("has a method 'open' which opens and returns a promise that resolves to a chat model", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesInitialized'], {}, ['rosterGroupsFetched', 'chatBoxesInitialized'], {},
async (done, _converse) => { async (done, _converse) => {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -321,9 +321,8 @@ ...@@ -321,9 +321,8 @@
}); });
describe("The \"settings\" API", function() { describe("The \"settings\" API", function() {
it("has methods 'get' and 'set' to set configuration settings", mock.initConverse( it("has methods 'get' and 'set' to set configuration settings",
null, null, {'play_sounds': true}, mock.initConverse(null, {'play_sounds': true}, (done, _converse) => {
(done, _converse) => {
expect(_.keys(_converse.api.settings)).toEqual(["update", "get", "set"]); expect(_.keys(_converse.api.settings)).toEqual(["update", "get", "set"]);
expect(_converse.api.settings.get("play_sounds")).toBe(true); expect(_converse.api.settings.get("play_sounds")).toBe(true);
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
it("stores the features it receives", it("stores the features it receives",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
const IQ_stanzas = _converse.connection.IQ_stanzas; const IQ_stanzas = _converse.connection.IQ_stanzas;
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
describe("Whenever converse.js discovers a new server feature", function () { describe("Whenever converse.js discovers a new server feature", function () {
it("emits the serviceDiscovered event", it("emits the serviceDiscovered event",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
function (done, _converse) { function (done, _converse) {
sinon.spy(_converse.api, "trigger"); sinon.spy(_converse.api, "trigger");
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
it("can be opened by clicking a button in the chat toolbar", it("can be opened by clicking a button in the chat toolbar",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
it("is opened to autocomplete emojis in the textarea", it("is opened to autocomplete emojis in the textarea",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
it("allows you to search for particular emojis", it("allows you to search for particular emojis",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -161,7 +161,7 @@ ...@@ -161,7 +161,7 @@
describe("A Chat Message", function () { describe("A Chat Message", function () {
it("will display larger if it's only emojis", it("will display larger if it's only emojis",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {'use_system_emojis': true}, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {'use_system_emojis': true},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
})); }));
it("will open and display headline messages", mock.initConverse( it("will open and display headline messages", mock.initConverse(
null, ['rosterGroupsFetched'], {}, function (done, _converse) { ['rosterGroupsFetched'], {}, function (done, _converse) {
/* <message from='notify.example.com' /* <message from='notify.example.com'
* to='romeo@im.example.com' * to='romeo@im.example.com'
......
...@@ -172,7 +172,7 @@ ...@@ -172,7 +172,7 @@
it("does not appear in private chats", it("does not appear in private chats",
mock.initConverse( mock.initConverse(
null, ['emojisInitialized'], {}, ['emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current', 3); await test_utils.waitForRoster(_converse, 'current', 3);
...@@ -191,7 +191,7 @@ ...@@ -191,7 +191,7 @@
})); }));
it("does not appear in MUC chats", mock.initConverse( it("does not appear in MUC chats", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
...@@ -233,7 +233,7 @@ ...@@ -233,7 +233,7 @@
})); }));
it("appears in MUC chats", mock.initConverse( it("appears in MUC chats", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -464,7 +464,7 @@ ...@@ -464,7 +464,7 @@
it("shows an error message if the file is too large", it("shows an error message if the file is too large",
mock.initConverse( mock.initConverse(
null, ['emojisInitialized'], {}, ['emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
const IQ_stanzas = _converse.connection.IQ_stanzas; const IQ_stanzas = _converse.connection.IQ_stanzas;
...@@ -587,7 +587,7 @@ ...@@ -587,7 +587,7 @@
describe("While a file is being uploaded", function () { describe("While a file is being uploaded", function () {
it("shows a progress bar", mock.initConverse( it("shows a progress bar", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
it("contains a checkbox to indicate whether the computer is trusted or not", it("contains a checkbox to indicate whether the computer is trusted or not",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: false }, allow_registration: false },
async function (done, _converse) { async function (done, _converse) {
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
it("checkbox can be set to false by default", it("checkbox can be set to false by default",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
trusted: false, trusted: false,
allow_registration: false }, allow_registration: false },
......
...@@ -17,9 +17,7 @@ ...@@ -17,9 +17,7 @@
describe("The XEP-0313 Archive", function () { describe("The XEP-0313 Archive", function () {
it("is queried when the user enters a new MUC", it("is queried when the user enters a new MUC",
mock.initConverse( mock.initConverse(['discoInitialized'], {'archived_messages_page_size': 2}, async function (done, _converse) {
null, ['discoInitialized'], {'archived_messages_page_size': 2},
async function (done, _converse) {
spyOn(_converse.ChatBox.prototype, 'fetchArchivedMessages').and.callThrough(); spyOn(_converse.ChatBox.prototype, 'fetchArchivedMessages').and.callThrough();
const sent_IQs = _converse.connection.IQ_stanzas; const sent_IQs = _converse.connection.IQ_stanzas;
...@@ -211,7 +209,7 @@ ...@@ -211,7 +209,7 @@
it("is discarded if it doesn't come from the right sender", it("is discarded if it doesn't come from the right sender",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
...@@ -267,7 +265,7 @@ ...@@ -267,7 +265,7 @@
it("updates the is_archived value of an already cached version", it("updates the is_archived value of an already cached version",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'trek-radio@conference.lightwitch.org', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'trek-radio@conference.lightwitch.org', 'romeo');
...@@ -315,7 +313,7 @@ ...@@ -315,7 +313,7 @@
it("isn't shown as duplicate by comparing its stanza id or archive id", it("isn't shown as duplicate by comparing its stanza id or archive id",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'trek-radio@conference.lightwitch.org', 'jcbrand'); await test_utils.openAndEnterChatRoom(_converse, 'trek-radio@conference.lightwitch.org', 'jcbrand');
...@@ -354,7 +352,7 @@ ...@@ -354,7 +352,7 @@
it("isn't shown as duplicate by comparing only the archive id", it("isn't shown as duplicate by comparing only the archive id",
mock.initConverse( mock.initConverse(
null, ['discoInitialized'], {}, ['discoInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.openAndEnterChatRoom(_converse, 'discuss@conference.conversejs.org', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'discuss@conference.conversejs.org', 'romeo');
...@@ -407,9 +405,7 @@ ...@@ -407,9 +405,7 @@
describe("The archive.query API", function () { describe("The archive.query API", function () {
it("can be used to query for all archived messages", it("can be used to query for all archived messages",
mock.initConverse( mock.initConverse(['discoInitialized'], {}, async function (done, _converse) {
null, ['discoInitialized'], {},
async function (done, _converse) {
const sendIQ = _converse.connection.sendIQ; const sendIQ = _converse.connection.sendIQ;
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
...@@ -427,9 +423,7 @@ ...@@ -427,9 +423,7 @@
})); }));
it("can be used to query for all messages to/from a particular JID", it("can be used to query for all messages to/from a particular JID",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -458,9 +452,7 @@ ...@@ -458,9 +452,7 @@
})); }));
it("can be used to query for archived messages from a chat room", it("can be used to query for archived messages from a chat room",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
const room_jid = 'coven@chat.shakespeare.lit'; const room_jid = 'coven@chat.shakespeare.lit';
_converse.api.archive.query({'with': room_jid, 'groupchat': true}); _converse.api.archive.query({'with': room_jid, 'groupchat': true});
...@@ -485,9 +477,7 @@ ...@@ -485,9 +477,7 @@
})); }));
it("checks whether returned MAM messages from a MUC room are from the right JID", it("checks whether returned MAM messages from a MUC room are from the right JID",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
const room_jid = 'coven@chat.shakespeare.lit'; const room_jid = 'coven@chat.shakespeare.lit';
const promise = _converse.api.archive.query({'with': room_jid, 'groupchat': true, 'max':'10'}); const promise = _converse.api.archive.query({'with': room_jid, 'groupchat': true, 'max':'10'});
...@@ -556,9 +546,7 @@ ...@@ -556,9 +546,7 @@
})); }));
it("can be used to query for all messages in a certain timespan", it("can be used to query for all messages in a certain timespan",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -596,9 +584,7 @@ ...@@ -596,9 +584,7 @@
})); }));
it("throws a TypeError if an invalid date is provided", it("throws a TypeError if an invalid date is provided",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
try { try {
...@@ -610,9 +596,7 @@ ...@@ -610,9 +596,7 @@
})); }));
it("can be used to query for all messages after a certain time", it("can be used to query for all messages after a certain time",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -646,9 +630,7 @@ ...@@ -646,9 +630,7 @@
})); }));
it("can be used to query for a limited set of results", it("can be used to query for a limited set of results",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -682,9 +664,7 @@ ...@@ -682,9 +664,7 @@
})); }));
it("can be used to page through results", it("can be used to page through results",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -722,9 +702,7 @@ ...@@ -722,9 +702,7 @@
})); }));
it("accepts \"before\" with an empty string as value to reverse the order", it("accepts \"before\" with an empty string as value to reverse the order",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -754,9 +732,7 @@ ...@@ -754,9 +732,7 @@
})); }));
it("accepts a _converse.RSM object for the query options", it("accepts a _converse.RSM object for the query options",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -798,9 +774,7 @@ ...@@ -798,9 +774,7 @@
})); }));
it("returns an object which includes the messages and a _converse.RSM object", it("returns an object which includes the messages and a _converse.RSM object",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, null, [Strophe.NS.MAM]);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -886,9 +860,7 @@ ...@@ -886,9 +860,7 @@
describe("The default preference", function () { describe("The default preference", function () {
it("is set once server support for MAM has been confirmed", it("is set once server support for MAM has been confirmed",
mock.initConverse( mock.initConverse([], {}, async function (done, _converse) {
null, [], {},
async function (done, _converse) {
const entity = await _converse.api.disco.entities.get(_converse.domain); const entity = await _converse.api.disco.entities.get(_converse.domain);
let sent_stanza, IQ_id; let sent_stanza, IQ_id;
...@@ -969,9 +941,7 @@ ...@@ -969,9 +941,7 @@
describe("A Chatbox", function () { describe("A Chatbox", function () {
it("will fetch archived messages once it's opened", it("will fetch archived messages once it's opened",
mock.initConverse( mock.initConverse(['discoInitialized'], {}, async function (done, _converse) {
null, ['discoInitialized'], {},
async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit'; const contact_jid = mock.cur_names[0].replace(/ /g,'.').toLowerCase() + '@montague.lit';
...@@ -1031,9 +1001,7 @@ ...@@ -1031,9 +1001,7 @@
})); }));
it("will show an error message if the MAM query times out", it("will show an error message if the MAM query times out",
mock.initConverse( mock.initConverse(['discoInitialized'], {}, async function (done, _converse) {
null, ['discoInitialized'], {},
async function (done, _converse) {
const sendIQ = _converse.connection.sendIQ; const sendIQ = _converse.connection.sendIQ;
......
This diff is collapsed.
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
it("shows chats that have been minimized", it("shows chats that have been minimized",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
it("can be toggled to hide or show minimized chats", it("can be toggled to hide or show minimized chats",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
it("shows the number messages received to minimized chats", it("shows the number messages received to minimized chats",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
function (done, _converse) { function (done, _converse) {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
...@@ -152,7 +152,7 @@ ...@@ -152,7 +152,7 @@
it("shows the number messages received to minimized groupchats", it("shows the number messages received to minimized groupchats",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'kitchen@conference.shakespeare.lit'; const muc_jid = 'kitchen@conference.shakespeare.lit';
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
it("allows you to set affiliations and roles", it("allows you to set affiliations and roles",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
spyOn(_converse.ChatRoomView.prototype, 'showModeratorToolsModal').and.callThrough(); spyOn(_converse.ChatRoomView.prototype, 'showModeratorToolsModal').and.callThrough();
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
it("shows an error message if a particular affiliation list may not be retrieved", it("shows an error message if a particular affiliation list may not be retrieved",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
spyOn(_converse.ChatRoomView.prototype, 'showModeratorToolsModal').and.callThrough(); spyOn(_converse.ChatRoomView.prototype, 'showModeratorToolsModal').and.callThrough();
......
This diff is collapsed.
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
it("is rejected if it's an unencapsulated forwarded message", it("is rejected if it's an unencapsulated forwarded message",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
it("is specially marked when you are mentioned in it", it("is specially marked when you are mentioned in it",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -72,7 +72,7 @@ ...@@ -72,7 +72,7 @@
it("can not be expected to have a unique id attribute", it("can not be expected to have a unique id attribute",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -104,7 +104,7 @@ ...@@ -104,7 +104,7 @@
it("is ignored if it has the same stanza-id of an already received on", it("is ignored if it has the same stanza-id of an already received on",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'room@muc.example.com'; const muc_jid = 'room@muc.example.com';
...@@ -150,7 +150,7 @@ ...@@ -150,7 +150,7 @@
it("will be discarded if it's a malicious message meant to look like a carbon copy", it("will be discarded if it's a malicious message meant to look like a carbon copy",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -210,7 +210,7 @@ ...@@ -210,7 +210,7 @@
it("keeps track of the sender's role and affiliation", it("keeps track of the sender's role and affiliation",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -338,7 +338,7 @@ ...@@ -338,7 +338,7 @@
it("keeps track whether you are the sender or not", it("keeps track whether you are the sender or not",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -358,7 +358,7 @@ ...@@ -358,7 +358,7 @@
it("can be replaced with a correction", it("can be replaced with a correction",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -425,7 +425,7 @@ ...@@ -425,7 +425,7 @@
it("can be sent as a correction by using the up arrow", it("can be sent as a correction by using the up arrow",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -530,7 +530,7 @@ ...@@ -530,7 +530,7 @@
it("will be shown as received upon MUC reflection", it("will be shown as received upon MUC reflection",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -573,7 +573,7 @@ ...@@ -573,7 +573,7 @@
it("gets updated with its stanza-id upon MUC reflection", it("gets updated with its stanza-id upon MUC reflection",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'room@muc.example.com'; const muc_jid = 'room@muc.example.com';
...@@ -609,7 +609,7 @@ ...@@ -609,7 +609,7 @@
it("can cause a delivery receipt to be returned", it("can cause a delivery receipt to be returned",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -645,7 +645,7 @@ ...@@ -645,7 +645,7 @@
it("can cause a chat marker to be returned", it("can cause a chat marker to be returned",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -714,7 +714,7 @@ ...@@ -714,7 +714,7 @@
it("highlights all users mentioned via XEP-0372 references", it("highlights all users mentioned via XEP-0372 references",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -760,7 +760,7 @@ ...@@ -760,7 +760,7 @@
it("gets parsed for mentions which get turned into references", it("gets parsed for mentions which get turned into references",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -842,7 +842,7 @@ ...@@ -842,7 +842,7 @@
it("parses for mentions as indicated with an @ preceded by a space or at the start of the text", it("parses for mentions as indicated with an @ preceded by a space or at the start of the text",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -877,7 +877,7 @@ ...@@ -877,7 +877,7 @@
it("can get corrected and given new references", it("can get corrected and given new references",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
...@@ -953,7 +953,7 @@ ...@@ -953,7 +953,7 @@
it("includes XEP-0372 references to that person", it("includes XEP-0372 references to that person",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'lounge@montague.lit'; const muc_jid = 'lounge@montague.lit';
......
...@@ -14,9 +14,7 @@ ...@@ -14,9 +14,7 @@
describe("an HTML5 Notification", function () { describe("an HTML5 Notification", function () {
it("is shown when a new private message is received", it("is shown when a new private message is received",
mock.initConverse( mock.initConverse(['rosterGroupsFetched'], {}, async (done, _converse) => {
null, ['rosterGroupsFetched'], {},
async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
spyOn(_converse, 'showMessageNotification').and.callThrough(); spyOn(_converse, 'showMessageNotification').and.callThrough();
...@@ -40,9 +38,7 @@ ...@@ -40,9 +38,7 @@
})); }));
it("is shown when you are mentioned in a groupchat", it("is shown when you are mentioned in a groupchat",
mock.initConverse( mock.initConverse(['rosterGroupsFetched'], {}, async (done, _converse) => {
null, ['rosterGroupsFetched'], {},
async (done, _converse) => {
await test_utils.createContacts(_converse, 'current'); await test_utils.createContacts(_converse, 'current');
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
...@@ -82,9 +78,7 @@ ...@@ -82,9 +78,7 @@
})); }));
it("is shown for headline messages", it("is shown for headline messages",
mock.initConverse( mock.initConverse(['rosterGroupsFetched'], {}, async (done, _converse) => {
null, ['rosterGroupsFetched'], {},
async (done, _converse) => {
spyOn(_converse, 'showMessageNotification').and.callThrough(); spyOn(_converse, 'showMessageNotification').and.callThrough();
spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true); spyOn(_converse, 'isMessageToHiddenChat').and.returnValue(true);
...@@ -166,9 +160,7 @@ ...@@ -166,9 +160,7 @@
describe("A notification sound", function () { describe("A notification sound", function () {
it("is played when the current user is mentioned in a groupchat", it("is played when the current user is mentioned in a groupchat",
mock.initConverse( mock.initConverse(['rosterGroupsFetched'], {}, async (done, _converse) => {
null, ['rosterGroupsFetched'], {},
async (done, _converse) => {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo'); await test_utils.openAndEnterChatRoom(_converse, 'lounge@montague.lit', 'romeo');
......
...@@ -77,7 +77,7 @@ ...@@ -77,7 +77,7 @@
it("adds methods for encrypting and decrypting messages via AES GCM", it("adds methods for encrypting and decrypting messages via AES GCM",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
const message = 'This message will be encrypted' const message = 'This message will be encrypted'
...@@ -94,7 +94,7 @@ ...@@ -94,7 +94,7 @@
it("enables encrypted messages to be sent and received", it("enables encrypted messages to be sent and received",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {}, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
let sent_stanza; let sent_stanza;
...@@ -234,7 +234,7 @@ ...@@ -234,7 +234,7 @@
it("enables encrypted groupchat messages to be sent and received", it("enables encrypted groupchat messages to be sent and received",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
// MEMO encryption works only in members only conferences // MEMO encryption works only in members only conferences
...@@ -381,7 +381,7 @@ ...@@ -381,7 +381,7 @@
it("will create a new device based on a received carbon message", it("will create a new device based on a received carbon message",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], [Strophe.NS.SID]); await test_utils.waitUntilDiscoConfirmed(_converse, _converse.bare_jid, [], [Strophe.NS.SID]);
...@@ -472,7 +472,7 @@ ...@@ -472,7 +472,7 @@
it("gracefully handles auth errors when trying to send encrypted groupchat messages", it("gracefully handles auth errors when trying to send encrypted groupchat messages",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
// MEMO encryption works only in members only conferences // MEMO encryption works only in members only conferences
...@@ -601,7 +601,7 @@ ...@@ -601,7 +601,7 @@
it("can receive a PreKeySignalMessage", it("can receive a PreKeySignalMessage",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
_converse.NUM_PREKEYS = 5; // Restrict to 5, otherwise the resulting stanza is too large to easily test _converse.NUM_PREKEYS = 5; // Restrict to 5, otherwise the resulting stanza is too large to easily test
...@@ -701,7 +701,7 @@ ...@@ -701,7 +701,7 @@
it("updates device lists based on PEP messages", it("updates device lists based on PEP messages",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {'allow_non_roster_messaging': true}, ['rosterGroupsFetched'], {'allow_non_roster_messaging': true},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -875,7 +875,7 @@ ...@@ -875,7 +875,7 @@
it("updates device bundles based on PEP messages", it("updates device bundles based on PEP messages",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -1025,7 +1025,7 @@ ...@@ -1025,7 +1025,7 @@
it("publishes a bundle with which an encrypted session can be created", it("publishes a bundle with which an encrypted session can be created",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -1104,7 +1104,7 @@ ...@@ -1104,7 +1104,7 @@
it("adds a toolbar button for starting an encrypted chat session", it("adds a toolbar button for starting an encrypted chat session",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -1269,7 +1269,7 @@ ...@@ -1269,7 +1269,7 @@
it("adds a toolbar button for starting an encrypted groupchat session", it("adds a toolbar button for starting an encrypted groupchat session",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {'view_mode': 'fullscreen'}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'view_mode': 'fullscreen'},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
...@@ -1451,7 +1451,7 @@ ...@@ -1451,7 +1451,7 @@
it("shows OMEMO device fingerprints in the user details modal", it("shows OMEMO device fingerprints in the user details modal",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async function (done, _converse) { async function (done, _converse) {
await test_utils.waitUntilDiscoConfirmed( await test_utils.waitUntilDiscoConfirmed(
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
it("includes a entity capabilities node", it("includes a entity capabilities node",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
(done, _converse) => { (done, _converse) => {
_converse.api.disco.own.identities.clear(); _converse.api.disco.own.identities.clear();
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
it("includes the saved status message", it("includes the saved status message",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async (done, _converse) => { async (done, _converse) => {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -111,7 +111,7 @@ ...@@ -111,7 +111,7 @@
it("has its priority taken into account", it("has its priority taken into account",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
(done, _converse) => { (done, _converse) => {
test_utils.openControlBox(); test_utils.openControlBox();
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
it("shows users currently present in the groupchat", it("shows users currently present in the groupchat",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {'muc_show_join_leave': false}, ['rosterGroupsFetched'], {'muc_show_join_leave': false},
async function (done, _converse) { async function (done, _converse) {
test_utils.openControlBox(); test_utils.openControlBox();
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
xit("adds hundreds of contacts to the roster", xit("adds hundreds of contacts to the roster",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
_converse.roster_groups = false; _converse.roster_groups = false;
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
xit("adds hundreds of contacts to the roster, with roster groups", xit("adds hundreds of contacts to the roster, with roster groups",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
// _converse.show_only_online_users = true; // _converse.show_only_online_users = true;
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
*/ */
it("Subscribe to contact, contact accepts and subscribes back", it("Subscribe to contact, contact accepts and subscribes back",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], ['rosterGroupsFetched'],
{ roster_groups: false }, { roster_groups: false },
async function (done, _converse) { async function (done, _converse) {
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
it("Alternate Flow: Contact Declines Subscription Request", it("Alternate Flow: Contact Declines Subscription Request",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
function (done, _converse) { function (done, _converse) {
/* The process by which a user subscribes to a contact, including /* The process by which a user subscribes to a contact, including
...@@ -451,7 +451,7 @@ ...@@ -451,7 +451,7 @@
it("Unsubscribe to a contact when subscription is mutual", it("Unsubscribe to a contact when subscription is mutual",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], ['rosterGroupsFetched'],
{ roster_groups: false }, { roster_groups: false },
async function (done, _converse) { async function (done, _converse) {
...@@ -510,7 +510,7 @@ ...@@ -510,7 +510,7 @@
})); }));
it("Receiving a subscription request", mock.initConverse( it("Receiving a subscription request", mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
spyOn(_converse.api, "trigger").and.callThrough(); spyOn(_converse.api, "trigger").and.callThrough();
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
describe("XEP-0357 Push Notifications", function () { describe("XEP-0357 Push Notifications", function () {
it("can be enabled", it("can be enabled",
mock.initConverse(null, mock.initConverse(
['rosterGroupsFetched'], { ['rosterGroupsFetched'], {
'push_app_servers': [{ 'push_app_servers': [{
'jid': 'push-5@client.example', 'jid': 'push-5@client.example',
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
})); }));
it("can be enabled for a MUC domain", it("can be enabled for a MUC domain",
mock.initConverse(null, mock.initConverse(
['rosterGroupsFetched'], { ['rosterGroupsFetched'], {
'enable_muc_push': true, 'enable_muc_push': true,
'push_app_servers': [{ 'push_app_servers': [{
...@@ -109,7 +109,7 @@ ...@@ -109,7 +109,7 @@
})); }));
it("can be disabled", it("can be disabled",
mock.initConverse(null, mock.initConverse(
['rosterGroupsFetched'], { ['rosterGroupsFetched'], {
'push_app_servers': [{ 'push_app_servers': [{
'jid': 'push-5@client.example', 'jid': 'push-5@client.example',
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
it("can require a secret token to be included", it("can require a secret token to be included",
mock.initConverse(null, mock.initConverse(
['rosterGroupsFetched'], { ['rosterGroupsFetched'], {
'push_app_servers': [{ 'push_app_servers': [{
'jid': 'push-5@client.example', 'jid': 'push-5@client.example',
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
it("is not available unless allow_registration=true", it("is not available unless allow_registration=true",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: false }, allow_registration: false },
async function (done, _converse) { async function (done, _converse) {
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
it("can be opened by clicking on the registration tab", it("can be opened by clicking on the registration tab",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: true }, allow_registration: true },
async function (done, _converse) { async function (done, _converse) {
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
it("allows the user to choose an XMPP provider's domain", it("allows the user to choose an XMPP provider's domain",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: true }, allow_registration: true },
async function (done, _converse) { async function (done, _converse) {
...@@ -81,7 +81,7 @@ ...@@ -81,7 +81,7 @@
it("will render a registration form as received from the XMPP provider", it("will render a registration form as received from the XMPP provider",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: true }, allow_registration: true },
async function (done, _converse) { async function (done, _converse) {
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
it("will set form_type to legacy and submit it as legacy", it("will set form_type to legacy and submit it as legacy",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: true }, allow_registration: true },
async function (done, _converse) { async function (done, _converse) {
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
it("will set form_type to xform and submit it as xform", it("will set form_type to xform and submit it as xform",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
allow_registration: true }, allow_registration: true },
async function (done, _converse) { async function (done, _converse) {
...@@ -267,7 +267,7 @@ ...@@ -267,7 +267,7 @@
it("renders the account registration form", it("renders the account registration form",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ auto_login: false, { auto_login: false,
view_mode: 'fullscreen', view_mode: 'fullscreen',
allow_registration: true }, allow_registration: true },
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
it("allows you to register your nickname in a room", it("allows you to register your nickname in a room",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {'auto_register_muc_nickname': true}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'auto_register_muc_nickname': true},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'coven@chat.shakespeare.lit'; const muc_jid = 'coven@chat.shakespeare.lit';
...@@ -71,7 +71,7 @@ ...@@ -71,7 +71,7 @@
it("allows you to automatically register your nickname when joining a room", it("allows you to automatically register your nickname when joining a room",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {'auto_register_muc_nickname': true}, ['rosterGroupsFetched', 'chatBoxesFetched'], {'auto_register_muc_nickname': true},
async function (done, _converse) { async function (done, _converse) {
const muc_jid = 'coven@chat.shakespeare.lit'; const muc_jid = 'coven@chat.shakespeare.lit';
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
describe("A list of open groupchats", function () { describe("A list of open groupchats", function () {
it("is shown in controlbox", mock.initConverse( it("is shown in controlbox", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'],
{ allow_bookmarks: false // Makes testing easier, otherwise we { allow_bookmarks: false // Makes testing easier, otherwise we
// have to mock stanza traffic. // have to mock stanza traffic.
}, async function (done, _converse) { }, async function (done, _converse) {
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
it("uses bookmarks to determine groupchat names", it("uses bookmarks to determine groupchat names",
mock.initConverse( mock.initConverse(
null,
['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'],
{'view_mode': 'fullscreen'}, {'view_mode': 'fullscreen'},
async function (done, _converse) { async function (done, _converse) {
...@@ -114,7 +113,7 @@ ...@@ -114,7 +113,7 @@
describe("A groupchat shown in the groupchats list", function () { describe("A groupchat shown in the groupchats list", function () {
it("is highlighted if it's currently open", mock.initConverse( it("is highlighted if it's currently open", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'],
{ view_mode: 'fullscreen', { view_mode: 'fullscreen',
allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic. allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic.
}, async function (done, _converse) { }, async function (done, _converse) {
...@@ -141,7 +140,7 @@ ...@@ -141,7 +140,7 @@
})); }));
it("has an info icon which opens a details modal when clicked", mock.initConverse( it("has an info icon which opens a details modal when clicked", mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'],
{ whitelisted_plugins: ['converse-roomslist'], { whitelisted_plugins: ['converse-roomslist'],
allow_bookmarks: false // Makes testing easier, otherwise we allow_bookmarks: false // Makes testing easier, otherwise we
// have to mock stanza traffic. // have to mock stanza traffic.
...@@ -246,7 +245,7 @@ ...@@ -246,7 +245,7 @@
})); }));
it("can be closed", mock.initConverse( it("can be closed", mock.initConverse(
null, ['rosterGroupsFetched', 'emojisInitialized'], ['rosterGroupsFetched', 'emojisInitialized'],
{ whitelisted_plugins: ['converse-roomslist'], { whitelisted_plugins: ['converse-roomslist'],
allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic. allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic.
}, },
...@@ -271,7 +270,7 @@ ...@@ -271,7 +270,7 @@
})); }));
it("shows unread messages directed at the user", mock.initConverse( it("shows unread messages directed at the user", mock.initConverse(
null, null, null,
{ whitelisted_plugins: ['converse-roomslist'], { whitelisted_plugins: ['converse-roomslist'],
allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic. allow_bookmarks: false // Makes testing easier, otherwise we have to mock stanza traffic.
}, async (done, _converse) => { }, async (done, _converse) => {
......
This diff is collapsed.
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
it("gets enabled with an <enable> stanza and resumed with a <resume> stanza", it("gets enabled with an <enable> stanza and resumed with a <resume> stanza",
mock.initConverse( mock.initConverse(
null, ['chatBoxesInitialized'], ['chatBoxesInitialized'],
{ 'auto_login': false, { 'auto_login': false,
'enable_smacks': true, 'enable_smacks': true,
'show_controlbox_by_default': true, 'show_controlbox_by_default': true,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
it("can be received with a hint", it("can be received with a hint",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
it("can be received without a hint", it("can be received without a hint",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current'); await test_utils.waitForRoster(_converse, 'current');
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
it("can be sent without a hint", it("can be sent without a hint",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
it("can be sent with a hint", it("can be sent with a hint",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched'], {}, ['rosterGroupsFetched', 'chatBoxesFetched'], {},
async (done, _converse) => { async (done, _converse) => {
await test_utils.waitForRoster(_converse, 'current', 1); await test_utils.waitForRoster(_converse, 'current', 1);
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
it("can be used to replay conversations", it("can be used to replay conversations",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched'], {}, ['rosterGroupsFetched'], {},
async function (done, _converse) { async function (done, _converse) {
_converse.allow_non_roster_messaging = true; _converse.allow_non_roster_messaging = true;
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
it("can be used to remove a contact", it("can be used to remove a contact",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {}, ['rosterGroupsFetched', 'chatBoxesFetched', 'emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
it("shows an alert when an error happened while removing the contact", it("shows an alert when an error happened while removing the contact",
mock.initConverse( mock.initConverse(
null, ['rosterGroupsFetched', 'emojisInitialized'], {}, ['rosterGroupsFetched', 'emojisInitialized'], {},
async function (done, _converse) { async function (done, _converse) {
test_utils.createContacts(_converse, 'current'); test_utils.createContacts(_converse, 'current');
......
...@@ -182,7 +182,7 @@ ...@@ -182,7 +182,7 @@
Strophe.Connection = MockConnection; Strophe.Connection = MockConnection;
async function initConverse (settings, spies={}) { async function initConverse (settings) {
window.localStorage.clear(); window.localStorage.clear();
window.sessionStorage.clear(); window.sessionStorage.clear();
...@@ -198,10 +198,6 @@ ...@@ -198,10 +198,6 @@
'view_mode': mock.view_mode, 'view_mode': mock.view_mode,
}, settings || {})); }, settings || {}));
if (spies && spies._converse) {
spies._converse.forEach(method => spyOn(_converse, method).and.callThrough());
}
_converse.ChatBoxViews.prototype.trimChat = function () {}; _converse.ChatBoxViews.prototype.trimChat = function () {};
_converse.api.vcard.get = function (model, force) { _converse.api.vcard.get = function (model, force) {
...@@ -244,15 +240,14 @@ ...@@ -244,15 +240,14 @@
return _converse; return _converse;
} }
mock.initConverse = function (spies={}, promise_names=[], settings=null, func) { mock.initConverse = function (promise_names=[], settings=null, func) {
if (_.isFunction(spies)) { if (_.isFunction(promise_names)) {
func = spies; func = promise_names;
spies = null;
promise_names = [] promise_names = []
settings = null; settings = null;
} }
return async done => { return async done => {
const _converse = await initConverse(settings, spies); const _converse = await initConverse(settings);
async function _done () { async function _done () {
if (_converse.api.connection.connected()) { if (_converse.api.connection.connected()) {
await _converse.api.user.logout(); await _converse.api.user.logout();
...@@ -264,7 +259,12 @@ ...@@ -264,7 +259,12 @@
done(); done();
} }
await Promise.all((promise_names || []).map(_converse.api.waitUntil)); await Promise.all((promise_names || []).map(_converse.api.waitUntil));
func(_done, _converse).catch(e => { fail(e); _done(); }); try {
await func(_done, _converse);
} catch(e) {
fail(e);
_done();
}
} }
}; };
return mock; return mock;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment