mirror of https://github.com/zulip/zulip.git
zjsunit: Lift restriction against mocking third party modules.
Use fully resolvable request paths because we need to be able to refer to third party modules, and to increase uniformity and explicitness. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
87a3650176
commit
876806eb4d
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -23,36 +23,36 @@ const _document = {
|
|||
},
|
||||
};
|
||||
|
||||
const compose_state = mock_module("compose_state");
|
||||
const channel = mock_module("channel");
|
||||
const compose_state = mock_esm("../../static/js/compose_state");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
|
||||
mock_module("padded_widget", {
|
||||
mock_esm("../../static/js/padded_widget", {
|
||||
update_padding: () => {},
|
||||
});
|
||||
mock_module("keydown_util", {
|
||||
mock_esm("../../static/js/keydown_util", {
|
||||
handle: (opts) => {
|
||||
filter_key_handlers = opts.handlers;
|
||||
},
|
||||
});
|
||||
mock_module("pm_list", {
|
||||
mock_esm("../../static/js/pm_list", {
|
||||
update_private_messages: () => {},
|
||||
});
|
||||
mock_module("popovers", {
|
||||
mock_esm("../../static/js/popovers", {
|
||||
hide_all_except_sidebars() {},
|
||||
hide_all() {},
|
||||
show_userlist_sidebar() {},
|
||||
});
|
||||
mock_module("resize", {
|
||||
mock_esm("../../static/js/resize", {
|
||||
resize_sidebars: () => {},
|
||||
resize_page_components: () => {},
|
||||
});
|
||||
mock_module("scroll_util", {
|
||||
mock_esm("../../static/js/scroll_util", {
|
||||
scroll_element_into_container: () => {},
|
||||
});
|
||||
mock_module("server_events", {
|
||||
mock_esm("../../static/js/server_events", {
|
||||
check_for_unsuspend() {},
|
||||
});
|
||||
mock_module("stream_popover", {
|
||||
mock_esm("../../static/js/stream_popover", {
|
||||
show_streamlist_sidebar() {},
|
||||
});
|
||||
set_global("document", _document);
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
|
||||
const alert_words = zrequire("alert_words");
|
||||
const alert_words_ui = zrequire("alert_words_ui");
|
||||
|
|
|
@ -5,7 +5,7 @@ const fs = require("fs");
|
|||
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -17,7 +17,7 @@ const StripeCheckout = set_global("StripeCheckout", {
|
|||
configure: () => {},
|
||||
});
|
||||
|
||||
const helpers = mock_module("billing/helpers", {
|
||||
const helpers = mock_esm("../../static/js/billing/helpers", {
|
||||
set_tab: () => {},
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const fs = require("fs");
|
|||
const jQueryFactory = require("jquery");
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -16,7 +16,7 @@ const jquery = jQueryFactory(dom.window);
|
|||
|
||||
const page_params = set_global("page_params", {});
|
||||
const history = set_global("history", {});
|
||||
const loading = mock_module("loading");
|
||||
const loading = mock_esm("../../static/js/loading");
|
||||
set_global("document", {
|
||||
title: "Zulip",
|
||||
});
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
mock_module("settings_bots", {
|
||||
mock_esm("../../static/js/settings_bots", {
|
||||
render_bots: () => {},
|
||||
});
|
||||
const bot_data = zrequire("bot_data");
|
||||
|
|
|
@ -4,12 +4,12 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
const timerender = mock_module("timerender");
|
||||
const timerender = mock_esm("../../static/js/timerender");
|
||||
|
||||
const people = zrequire("people");
|
||||
const presence = zrequire("presence");
|
||||
|
|
|
@ -4,15 +4,15 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
mock_module("padded_widget", {
|
||||
mock_esm("../../static/js/padded_widget", {
|
||||
update_padding: () => {},
|
||||
});
|
||||
|
||||
mock_module("message_viewport", {
|
||||
mock_esm("../../static/js/message_viewport", {
|
||||
height: () => 550,
|
||||
});
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@ const {JSDOM} = require("jsdom");
|
|||
const MockDate = require("mockdate");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -17,7 +17,7 @@ set_global("DOMParser", new JSDOM().window.DOMParser);
|
|||
let compose_actions_start_checked;
|
||||
let compose_actions_expected_opts;
|
||||
|
||||
mock_module("compose_actions", {
|
||||
mock_esm("../../static/js/compose_actions", {
|
||||
update_placeholder_text: noop,
|
||||
|
||||
start(msg_type, opts) {
|
||||
|
@ -27,7 +27,7 @@ mock_module("compose_actions", {
|
|||
},
|
||||
});
|
||||
|
||||
const server_events = mock_module("server_events");
|
||||
const server_events = mock_esm("../../static/js/server_events");
|
||||
const _navigator = {
|
||||
platform: "",
|
||||
};
|
||||
|
@ -41,30 +41,30 @@ const _document = {
|
|||
};
|
||||
|
||||
set_global("document", _document);
|
||||
const channel = mock_module("channel");
|
||||
const loading = mock_module("loading");
|
||||
const local_message = mock_module("local_message");
|
||||
const markdown = mock_module("markdown");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const loading = mock_esm("../../static/js/loading");
|
||||
const local_message = mock_esm("../../static/js/local_message");
|
||||
const markdown = mock_esm("../../static/js/markdown");
|
||||
const page_params = set_global("page_params", {});
|
||||
const reminder = mock_module("reminder", {
|
||||
const reminder = mock_esm("../../static/js/reminder", {
|
||||
is_deferred_delivery: noop,
|
||||
});
|
||||
const resize = mock_module("resize");
|
||||
const sent_messages = mock_module("sent_messages", {
|
||||
const resize = mock_esm("../../static/js/resize");
|
||||
const sent_messages = mock_esm("../../static/js/sent_messages", {
|
||||
start_tracking_message: noop,
|
||||
});
|
||||
const stream_edit = mock_module("stream_edit");
|
||||
const subs = mock_module("subs");
|
||||
const transmit = mock_module("transmit");
|
||||
const ui_util = mock_module("ui_util");
|
||||
mock_module("drafts", {
|
||||
const stream_edit = mock_esm("../../static/js/stream_edit");
|
||||
const subs = mock_esm("../../static/js/subs");
|
||||
const transmit = mock_esm("../../static/js/transmit");
|
||||
const ui_util = mock_esm("../../static/js/ui_util");
|
||||
mock_esm("../../static/js/drafts", {
|
||||
delete_draft_after_send: noop,
|
||||
});
|
||||
mock_module("notifications", {
|
||||
mock_esm("../../static/js/notifications", {
|
||||
notify_above_composebox: noop,
|
||||
clear_compose_notifications: noop,
|
||||
});
|
||||
mock_module("rendered_markdown", {
|
||||
mock_esm("../../static/js/rendered_markdown", {
|
||||
update_elements: () => {},
|
||||
});
|
||||
set_global("navigator", _navigator);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -15,28 +15,28 @@ set_global("document", {
|
|||
to_$: () => $("document-stub"),
|
||||
});
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const compose_fade = mock_module("compose_fade", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const compose_fade = mock_esm("../../static/js/compose_fade", {
|
||||
clear_compose: noop,
|
||||
});
|
||||
const compose_pm_pill = mock_module("compose_pm_pill");
|
||||
const hash_util = mock_module("hash_util");
|
||||
const narrow_state = mock_module("narrow_state", {
|
||||
const compose_pm_pill = mock_esm("../../static/js/compose_pm_pill");
|
||||
const hash_util = mock_esm("../../static/js/hash_util");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state", {
|
||||
set_compose_defaults: noop,
|
||||
});
|
||||
mock_module("notifications", {
|
||||
mock_esm("../../static/js/notifications", {
|
||||
clear_compose_notifications: noop,
|
||||
});
|
||||
mock_module("reload_state", {
|
||||
mock_esm("../../static/js/reload_state", {
|
||||
is_in_progress: () => false,
|
||||
});
|
||||
mock_module("drafts", {
|
||||
mock_esm("../../static/js/drafts", {
|
||||
update_draft: noop,
|
||||
});
|
||||
mock_module("common", {
|
||||
mock_esm("../../static/js/common", {
|
||||
status_classes: "status_classes",
|
||||
});
|
||||
mock_module("unread_ops", {
|
||||
mock_esm("../../static/js/unread_ops", {
|
||||
notify_server_message_read: noop,
|
||||
});
|
||||
set_global("current_msg_list", {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const compose_actions = mock_module("compose_actions");
|
||||
const compose_actions = mock_esm("../../static/js/compose_actions");
|
||||
const people = zrequire("people");
|
||||
|
||||
const compose_pm_pill = zrequire("compose_pm_pill");
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const compose_pm_pill = mock_module("compose_pm_pill");
|
||||
const compose_pm_pill = mock_esm("../../static/js/compose_pm_pill");
|
||||
|
||||
const compose_state = zrequire("compose_state");
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const events = require("./lib/events");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const page_params = set_global("page_params", {});
|
||||
const upload = mock_module("upload");
|
||||
mock_module("resize", {
|
||||
const upload = mock_esm("../../static/js/upload");
|
||||
mock_esm("../../static/js/resize", {
|
||||
watch_manual_resize() {},
|
||||
});
|
||||
set_global("csrf_token", "fake-csrf-token");
|
||||
|
|
|
@ -2,26 +2,26 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const compose = mock_module("compose", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const compose = mock_esm("../../static/js/compose", {
|
||||
finish: noop,
|
||||
});
|
||||
const message_store = mock_module("message_store", {
|
||||
const message_store = mock_esm("../../static/js/message_store", {
|
||||
user_ids: () => [],
|
||||
});
|
||||
const stream_topic_history = mock_module("stream_topic_history");
|
||||
const stream_topic_history = mock_esm("../../static/js/stream_topic_history");
|
||||
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
let autosize_called;
|
||||
|
||||
mock_module("compose_ui", {
|
||||
mock_esm("../../static/js/compose_ui", {
|
||||
autosize_textarea() {
|
||||
autosize_called = true;
|
||||
},
|
||||
|
|
|
@ -5,7 +5,7 @@ const {strict: assert} = require("assert");
|
|||
const jquery = require("jquery");
|
||||
const {JSDOM} = require("jsdom");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const {window} = new JSDOM("<!DOCTYPE html><p>Hello world</p>");
|
||||
|
@ -13,7 +13,7 @@ const {window} = new JSDOM("<!DOCTYPE html><p>Hello world</p>");
|
|||
const {DOMParser, document} = window;
|
||||
const $ = set_global("$", jquery(window));
|
||||
|
||||
const compose_ui = mock_module("compose_ui");
|
||||
const compose_ui = mock_esm("../../static/js/compose_ui");
|
||||
set_global("page_params", {
|
||||
development_environment: true,
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
@ -18,47 +18,47 @@ const typing_person1 = events.typing_person1;
|
|||
|
||||
set_global("setTimeout", (func) => func());
|
||||
|
||||
const activity = mock_module("activity");
|
||||
const alert_words_ui = mock_module("alert_words_ui");
|
||||
const attachments_ui = mock_module("attachments_ui");
|
||||
const bot_data = mock_module("bot_data");
|
||||
const composebox_typeahead = mock_module("composebox_typeahead");
|
||||
const emoji_picker = mock_module("emoji_picker");
|
||||
const hotspots = mock_module("hotspots");
|
||||
const markdown = mock_module("markdown");
|
||||
const message_edit = mock_module("message_edit");
|
||||
const message_events = mock_module("message_events");
|
||||
const message_list = mock_module("message_list");
|
||||
const muting_ui = mock_module("muting_ui");
|
||||
const night_mode = mock_module("night_mode");
|
||||
const notifications = mock_module("notifications");
|
||||
const reactions = mock_module("reactions");
|
||||
const realm_icon = mock_module("realm_icon");
|
||||
const realm_logo = mock_module("realm_logo");
|
||||
const reload = mock_module("reload");
|
||||
const scroll_bar = mock_module("scroll_bar");
|
||||
const settings_account = mock_module("settings_account");
|
||||
const settings_bots = mock_module("settings_bots");
|
||||
const settings_display = mock_module("settings_display");
|
||||
const settings_emoji = mock_module("settings_emoji");
|
||||
const settings_exports = mock_module("settings_exports");
|
||||
const settings_invites = mock_module("settings_invites");
|
||||
const settings_linkifiers = mock_module("settings_linkifiers");
|
||||
const settings_notifications = mock_module("settings_notifications");
|
||||
const settings_org = mock_module("settings_org");
|
||||
const settings_profile_fields = mock_module("settings_profile_fields");
|
||||
const settings_streams = mock_module("settings_streams");
|
||||
const settings_user_groups = mock_module("settings_user_groups");
|
||||
const settings_users = mock_module("settings_users");
|
||||
const stream_data = mock_module("stream_data");
|
||||
const stream_events = mock_module("stream_events");
|
||||
const submessage = mock_module("submessage");
|
||||
const typing_events = mock_module("typing_events");
|
||||
const ui = mock_module("ui");
|
||||
const unread_ops = mock_module("unread_ops");
|
||||
const user_events = mock_module("user_events");
|
||||
const user_groups = mock_module("user_groups");
|
||||
mock_module("compose");
|
||||
const activity = mock_esm("../../static/js/activity");
|
||||
const alert_words_ui = mock_esm("../../static/js/alert_words_ui");
|
||||
const attachments_ui = mock_esm("../../static/js/attachments_ui");
|
||||
const bot_data = mock_esm("../../static/js/bot_data");
|
||||
const composebox_typeahead = mock_esm("../../static/js/composebox_typeahead");
|
||||
const emoji_picker = mock_esm("../../static/js/emoji_picker");
|
||||
const hotspots = mock_esm("../../static/js/hotspots");
|
||||
const markdown = mock_esm("../../static/js/markdown");
|
||||
const message_edit = mock_esm("../../static/js/message_edit");
|
||||
const message_events = mock_esm("../../static/js/message_events");
|
||||
const message_list = mock_esm("../../static/js/message_list");
|
||||
const muting_ui = mock_esm("../../static/js/muting_ui");
|
||||
const night_mode = mock_esm("../../static/js/night_mode");
|
||||
const notifications = mock_esm("../../static/js/notifications");
|
||||
const reactions = mock_esm("../../static/js/reactions");
|
||||
const realm_icon = mock_esm("../../static/js/realm_icon");
|
||||
const realm_logo = mock_esm("../../static/js/realm_logo");
|
||||
const reload = mock_esm("../../static/js/reload");
|
||||
const scroll_bar = mock_esm("../../static/js/scroll_bar");
|
||||
const settings_account = mock_esm("../../static/js/settings_account");
|
||||
const settings_bots = mock_esm("../../static/js/settings_bots");
|
||||
const settings_display = mock_esm("../../static/js/settings_display");
|
||||
const settings_emoji = mock_esm("../../static/js/settings_emoji");
|
||||
const settings_exports = mock_esm("../../static/js/settings_exports");
|
||||
const settings_invites = mock_esm("../../static/js/settings_invites");
|
||||
const settings_linkifiers = mock_esm("../../static/js/settings_linkifiers");
|
||||
const settings_notifications = mock_esm("../../static/js/settings_notifications");
|
||||
const settings_org = mock_esm("../../static/js/settings_org");
|
||||
const settings_profile_fields = mock_esm("../../static/js/settings_profile_fields");
|
||||
const settings_streams = mock_esm("../../static/js/settings_streams");
|
||||
const settings_user_groups = mock_esm("../../static/js/settings_user_groups");
|
||||
const settings_users = mock_esm("../../static/js/settings_users");
|
||||
const stream_data = mock_esm("../../static/js/stream_data");
|
||||
const stream_events = mock_esm("../../static/js/stream_events");
|
||||
const submessage = mock_esm("../../static/js/submessage");
|
||||
const typing_events = mock_esm("../../static/js/typing_events");
|
||||
const ui = mock_esm("../../static/js/ui");
|
||||
const unread_ops = mock_esm("../../static/js/unread_ops");
|
||||
const user_events = mock_esm("../../static/js/user_events");
|
||||
const user_groups = mock_esm("../../static/js/user_groups");
|
||||
mock_esm("../../static/js/compose");
|
||||
|
||||
const electron_bridge = set_global("electron_bridge", {});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
|
@ -11,15 +11,15 @@ const events = require("./lib/events");
|
|||
const event_fixtures = events.fixtures;
|
||||
const test_user = events.test_user;
|
||||
|
||||
const compose_fade = mock_module("compose_fade");
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const overlays = mock_module("overlays");
|
||||
const compose_fade = mock_esm("../../static/js/compose_fade");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
const overlays = mock_esm("../../static/js/overlays");
|
||||
const page_params = set_global("page_params", {});
|
||||
const settings_org = mock_module("settings_org");
|
||||
const settings_streams = mock_module("settings_streams");
|
||||
const stream_events = mock_module("stream_events");
|
||||
const stream_list = mock_module("stream_list");
|
||||
const subs = mock_module("subs");
|
||||
const settings_org = mock_esm("../../static/js/settings_org");
|
||||
const settings_streams = mock_esm("../../static/js/settings_streams");
|
||||
const stream_events = mock_esm("../../static/js/stream_events");
|
||||
const stream_list = mock_esm("../../static/js/stream_list");
|
||||
const subs = mock_esm("../../static/js/subs");
|
||||
set_global("current_msg_list", {});
|
||||
|
||||
const peer_data = zrequire("peer_data");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire, with_overrides} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire, with_overrides} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -24,11 +24,11 @@ const localStorage = set_global("localStorage", {
|
|||
ls_container.clear();
|
||||
},
|
||||
});
|
||||
const compose_state = mock_module("compose_state");
|
||||
mock_module("markdown", {
|
||||
const compose_state = mock_esm("../../static/js/compose_state");
|
||||
mock_esm("../../static/js/markdown", {
|
||||
apply_markdown: noop,
|
||||
});
|
||||
mock_module("stream_data", {
|
||||
mock_esm("../../static/js/stream_data", {
|
||||
get_color() {
|
||||
return "#FFFFFF";
|
||||
},
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const noop = () => {};
|
||||
mock_module("list_widget", {
|
||||
mock_esm("../../static/js/list_widget", {
|
||||
create: () => ({init: noop}),
|
||||
});
|
||||
const {DropdownListWidget: dropdown_list_widget} = zrequire("dropdown_list_widget");
|
||||
|
|
|
@ -4,27 +4,27 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const MockDate = require("mockdate");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const local_message = mock_module("local_message");
|
||||
const markdown = mock_module("markdown");
|
||||
const local_message = mock_esm("../../static/js/local_message");
|
||||
const markdown = mock_esm("../../static/js/markdown");
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
let disparities = [];
|
||||
let messages_to_rerender = [];
|
||||
|
||||
mock_module("ui", {
|
||||
mock_esm("../../static/js/ui", {
|
||||
show_failed_message_success: () => {},
|
||||
});
|
||||
|
||||
mock_module("sent_messages", {
|
||||
mock_esm("../../static/js/sent_messages", {
|
||||
mark_disparity: (local_id) => {
|
||||
disparities.push(local_id);
|
||||
},
|
||||
});
|
||||
|
||||
mock_module("message_store", {
|
||||
mock_esm("../../static/js/message_store", {
|
||||
get: () => ({failed_request: true}),
|
||||
|
||||
update_booleans: () => {},
|
||||
|
@ -38,7 +38,7 @@ set_global("home_msg_list", {
|
|||
},
|
||||
});
|
||||
|
||||
mock_module("message_list");
|
||||
mock_esm("../../static/js/message_list");
|
||||
set_global("current_msg_list", "");
|
||||
|
||||
const echo = zrequire("echo");
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
mock_module("message_scroll", {
|
||||
mock_esm("../../static/js/message_scroll", {
|
||||
hide_loading_older: () => {},
|
||||
|
||||
show_loading_older: () => {},
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const message_store = mock_module("message_store");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
const stream_data = zrequire("stream_data");
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const ui_report = mock_module("ui_report", {
|
||||
const ui_report = mock_esm("../../static/js/ui_report", {
|
||||
displayed_error: false,
|
||||
|
||||
error: () => {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -13,23 +13,23 @@ set_global("location", {
|
|||
});
|
||||
set_global("to_$", () => window_stub);
|
||||
|
||||
mock_module("search", {
|
||||
mock_esm("../../static/js/search", {
|
||||
update_button_visibility: () => {},
|
||||
});
|
||||
set_global("document", "document-stub");
|
||||
const history = set_global("history", {});
|
||||
|
||||
const admin = mock_module("admin");
|
||||
const drafts = mock_module("drafts");
|
||||
const floating_recipient_bar = mock_module("floating_recipient_bar");
|
||||
const info_overlay = mock_module("info_overlay");
|
||||
const message_viewport = mock_module("message_viewport");
|
||||
const narrow = mock_module("narrow");
|
||||
const overlays = mock_module("overlays");
|
||||
const settings = mock_module("settings");
|
||||
const subs = mock_module("subs");
|
||||
const ui_util = mock_module("ui_util");
|
||||
mock_module("top_left_corner", {
|
||||
const admin = mock_esm("../../static/js/admin");
|
||||
const drafts = mock_esm("../../static/js/drafts");
|
||||
const floating_recipient_bar = mock_esm("../../static/js/floating_recipient_bar");
|
||||
const info_overlay = mock_esm("../../static/js/info_overlay");
|
||||
const message_viewport = mock_esm("../../static/js/message_viewport");
|
||||
const narrow = mock_esm("../../static/js/narrow");
|
||||
const overlays = mock_esm("../../static/js/overlays");
|
||||
const settings = mock_esm("../../static/js/settings");
|
||||
const subs = mock_esm("../../static/js/subs");
|
||||
const ui_util = mock_esm("../../static/js/ui_util");
|
||||
mock_esm("../../static/js/top_left_corner", {
|
||||
handle_narrow_deactivated: () => {},
|
||||
});
|
||||
set_global("favicon", {});
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {
|
||||
mock_module,
|
||||
mock_esm,
|
||||
set_global,
|
||||
with_field,
|
||||
with_overrides,
|
||||
|
@ -39,25 +39,25 @@ const page_params = set_global("page_params", {});
|
|||
// jQuery stuff should go away if we make an initialize() method.
|
||||
set_global("document", "document-stub");
|
||||
|
||||
const compose_actions = mock_module("compose_actions");
|
||||
const condense = mock_module("condense");
|
||||
const drafts = mock_module("drafts");
|
||||
const emoji_picker = mock_module("emoji_picker", {
|
||||
const compose_actions = mock_esm("../../static/js/compose_actions");
|
||||
const condense = mock_esm("../../static/js/condense");
|
||||
const drafts = mock_esm("../../static/js/drafts");
|
||||
const emoji_picker = mock_esm("../../static/js/emoji_picker", {
|
||||
reactions_popped: () => false,
|
||||
});
|
||||
const gear_menu = mock_module("gear_menu", {
|
||||
const gear_menu = mock_esm("../../static/js/gear_menu", {
|
||||
is_open: () => false,
|
||||
});
|
||||
const hashchange = mock_module("hashchange", {
|
||||
const hashchange = mock_esm("../../static/js/hashchange", {
|
||||
in_recent_topics_hash: () => false,
|
||||
});
|
||||
const lightbox = mock_module("lightbox");
|
||||
const list_util = mock_module("list_util");
|
||||
const message_edit = mock_module("message_edit");
|
||||
const muting_ui = mock_module("muting_ui");
|
||||
const narrow = mock_module("narrow");
|
||||
const navigate = mock_module("navigate");
|
||||
const overlays = mock_module("overlays", {
|
||||
const lightbox = mock_esm("../../static/js/lightbox");
|
||||
const list_util = mock_esm("../../static/js/list_util");
|
||||
const message_edit = mock_esm("../../static/js/message_edit");
|
||||
const muting_ui = mock_esm("../../static/js/muting_ui");
|
||||
const narrow = mock_esm("../../static/js/narrow");
|
||||
const navigate = mock_esm("../../static/js/navigate");
|
||||
const overlays = mock_esm("../../static/js/overlays", {
|
||||
is_active: () => false,
|
||||
settings_open: () => false,
|
||||
streams_open: () => false,
|
||||
|
@ -65,29 +65,29 @@ const overlays = mock_module("overlays", {
|
|||
drafts_open: () => false,
|
||||
info_overlay_open: () => false,
|
||||
});
|
||||
const popovers = mock_module("popovers", {
|
||||
const popovers = mock_esm("../../static/js/popovers", {
|
||||
actions_popped: () => false,
|
||||
message_info_popped: () => false,
|
||||
user_sidebar_popped: () => false,
|
||||
user_info_popped: () => false,
|
||||
});
|
||||
const reactions = mock_module("reactions");
|
||||
const search = mock_module("search");
|
||||
const stream_list = mock_module("stream_list");
|
||||
const subs = mock_module("subs");
|
||||
const reactions = mock_esm("../../static/js/reactions");
|
||||
const search = mock_esm("../../static/js/search");
|
||||
const stream_list = mock_esm("../../static/js/stream_list");
|
||||
const subs = mock_esm("../../static/js/subs");
|
||||
|
||||
mock_module("stream_popover", {
|
||||
mock_esm("../../static/js/stream_popover", {
|
||||
stream_popped: () => false,
|
||||
topic_popped: () => false,
|
||||
all_messages_popped: () => false,
|
||||
starred_messages_popped: () => false,
|
||||
});
|
||||
|
||||
mock_module("hotspots", {
|
||||
mock_esm("../../static/js/hotspots", {
|
||||
is_open: () => false,
|
||||
});
|
||||
|
||||
mock_module("recent_topics", {
|
||||
mock_esm("../../static/js/recent_topics", {
|
||||
is_visible: () => false,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -11,7 +11,7 @@ set_global("document", {});
|
|||
const noop = () => {};
|
||||
const example_img_link = "http://example.com/example.png";
|
||||
|
||||
mock_module("ui_util", {
|
||||
mock_esm("../../static/js/ui_util", {
|
||||
place_caret_at_end: noop,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
set_global("Image", class Image {});
|
||||
mock_module("overlays", {
|
||||
mock_esm("../../static/js/overlays", {
|
||||
close_overlay: () => {},
|
||||
|
||||
close_active: () => {},
|
||||
open_overlay: () => {},
|
||||
});
|
||||
mock_module("popovers", {
|
||||
mock_esm("../../static/js/popovers", {
|
||||
hide_all: () => {},
|
||||
});
|
||||
|
||||
const message_store = mock_module("message_store");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
const rows = zrequire("rows");
|
||||
|
||||
const lightbox = zrequire("lightbox");
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
// We need these stubs to get by instanceof checks.
|
||||
// The ListWidget library allows you to insert objects
|
||||
// that are either jQuery, Element, or just raw HTML
|
||||
// strings. We initially test with raw strings.
|
||||
const ui = mock_module("ui");
|
||||
const ui = mock_esm("../../static/js/ui");
|
||||
set_global("Element", () => {});
|
||||
set_global("jQuery", "stub");
|
||||
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const condense = mock_module("condense");
|
||||
const message_edit = mock_module("message_edit");
|
||||
const message_list = mock_module("message_list");
|
||||
const notifications = mock_module("notifications");
|
||||
const condense = mock_esm("../../static/js/condense");
|
||||
const message_edit = mock_esm("../../static/js/message_edit");
|
||||
const message_list = mock_esm("../../static/js/message_list");
|
||||
const notifications = mock_esm("../../static/js/notifications");
|
||||
const page_params = set_global("page_params", {});
|
||||
const pm_list = mock_module("pm_list");
|
||||
const stream_list = mock_module("stream_list");
|
||||
const unread_ui = mock_module("unread_ui");
|
||||
const pm_list = mock_esm("../../static/js/pm_list");
|
||||
const stream_list = mock_esm("../../static/js/stream_list");
|
||||
const unread_ui = mock_esm("../../static/js/unread_ui");
|
||||
set_global("current_msg_list", {});
|
||||
|
||||
const people = zrequire("people");
|
||||
|
|
|
@ -4,7 +4,7 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -15,28 +15,28 @@ const noop = () => {};
|
|||
function MessageListView() {
|
||||
return {};
|
||||
}
|
||||
mock_module("message_list_view", {
|
||||
mock_esm("../../static/js/message_list_view", {
|
||||
MessageListView,
|
||||
});
|
||||
|
||||
mock_module("recent_topics", {
|
||||
mock_esm("../../static/js/recent_topics", {
|
||||
process_messages: noop,
|
||||
});
|
||||
// Still required for page_params.initial_pointer
|
||||
set_global("page_params", {});
|
||||
mock_module("ui_report", {
|
||||
mock_esm("../../static/js/ui_report", {
|
||||
hide_error: noop,
|
||||
});
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const message_store = mock_module("message_store");
|
||||
const message_util = mock_module("message_util");
|
||||
const pm_list = mock_module("pm_list");
|
||||
const server_events = mock_module("server_events");
|
||||
const stream_list = mock_module("stream_list", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
const message_util = mock_esm("../../static/js/message_util");
|
||||
const pm_list = mock_esm("../../static/js/pm_list");
|
||||
const server_events = mock_esm("../../static/js/server_events");
|
||||
const stream_list = mock_esm("../../static/js/stream_list", {
|
||||
maybe_scroll_narrow_into_view: () => {},
|
||||
});
|
||||
mock_module("message_scroll", {
|
||||
mock_esm("../../static/js/message_scroll", {
|
||||
show_loading_older: noop,
|
||||
hide_loading_older: noop,
|
||||
show_loading_newer: noop,
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const ui = mock_module("ui");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const ui = mock_esm("../../static/js/ui");
|
||||
|
||||
mock_module("starred_messages", {
|
||||
mock_esm("../../static/js/starred_messages", {
|
||||
add: () => {},
|
||||
|
||||
remove: () => {},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
@ -13,7 +13,7 @@ const $ = require("../zjsunit/zjquery");
|
|||
|
||||
const noop = function () {};
|
||||
|
||||
mock_module("filter", {
|
||||
mock_esm("../../static/js/filter", {
|
||||
Filter: noop,
|
||||
});
|
||||
set_global("document", {
|
||||
|
@ -24,8 +24,8 @@ set_global("document", {
|
|||
},
|
||||
});
|
||||
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const stream_data = mock_module("stream_data");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
const stream_data = mock_esm("../../static/js/stream_data");
|
||||
|
||||
const muting = zrequire("muting");
|
||||
const {MessageList} = zrequire("message_list");
|
||||
|
|
|
@ -4,7 +4,7 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
set_global("document", "document-stub");
|
||||
|
@ -16,7 +16,7 @@ const page_params = set_global("page_params", {
|
|||
});
|
||||
set_global("home_msg_list", "stub");
|
||||
// timerender calls setInterval when imported
|
||||
mock_module("timerender", {
|
||||
mock_esm("../../static/js/timerender", {
|
||||
render_date(time1, time2) {
|
||||
if (time2 === undefined) {
|
||||
return [{outerHTML: String(time1.getTime())}];
|
||||
|
@ -31,7 +31,7 @@ mock_module("timerender", {
|
|||
},
|
||||
});
|
||||
|
||||
mock_module("rows", {
|
||||
mock_esm("../../static/js/rows", {
|
||||
get_table() {
|
||||
return {
|
||||
children() {
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
mock_module("stream_topic_history", {
|
||||
mock_esm("../../static/js/stream_topic_history", {
|
||||
add_message: noop,
|
||||
});
|
||||
|
||||
mock_module("recent_senders", {
|
||||
mock_esm("../../static/js/recent_senders", {
|
||||
process_message_for_senders: noop,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -10,7 +10,7 @@ set_global("page_params", {
|
|||
stop_words: ["what", "about"],
|
||||
});
|
||||
|
||||
const stream_topic_history = mock_module("stream_topic_history");
|
||||
const stream_topic_history = mock_esm("../../static/js/stream_topic_history");
|
||||
const hash_util = zrequire("hash_util");
|
||||
|
||||
const compose_state = zrequire("compose_state");
|
||||
|
|
|
@ -2,33 +2,33 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
mock_module("resize", {
|
||||
mock_esm("../../static/js/resize", {
|
||||
resize_stream_filters_container: () => {},
|
||||
});
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const compose = mock_module("compose");
|
||||
const compose_actions = mock_module("compose_actions");
|
||||
const hashchange = mock_module("hashchange");
|
||||
const message_fetch = mock_module("message_fetch");
|
||||
const message_list = mock_module("message_list", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const compose = mock_esm("../../static/js/compose");
|
||||
const compose_actions = mock_esm("../../static/js/compose_actions");
|
||||
const hashchange = mock_esm("../../static/js/hashchange");
|
||||
const message_fetch = mock_esm("../../static/js/message_fetch");
|
||||
const message_list = mock_esm("../../static/js/message_list", {
|
||||
set_narrowed(value) {
|
||||
message_list.narrowed = value;
|
||||
},
|
||||
});
|
||||
const message_scroll = mock_module("message_scroll");
|
||||
const message_view_header = mock_module("message_view_header");
|
||||
const notifications = mock_module("notifications");
|
||||
const search = mock_module("search");
|
||||
const stream_list = mock_module("stream_list");
|
||||
const top_left_corner = mock_module("top_left_corner");
|
||||
const typing_events = mock_module("typing_events");
|
||||
const ui_util = mock_module("ui_util");
|
||||
const unread_ops = mock_module("unread_ops");
|
||||
mock_module("recent_topics", {
|
||||
const message_scroll = mock_esm("../../static/js/message_scroll");
|
||||
const message_view_header = mock_esm("../../static/js/message_view_header");
|
||||
const notifications = mock_esm("../../static/js/notifications");
|
||||
const search = mock_esm("../../static/js/search");
|
||||
const stream_list = mock_esm("../../static/js/stream_list");
|
||||
const top_left_corner = mock_esm("../../static/js/top_left_corner");
|
||||
const typing_events = mock_esm("../../static/js/typing_events");
|
||||
const ui_util = mock_esm("../../static/js/ui_util");
|
||||
const unread_ops = mock_esm("../../static/js/unread_ops");
|
||||
mock_esm("../../static/js/recent_topics", {
|
||||
hide: () => {},
|
||||
is_visible: () => {},
|
||||
});
|
||||
|
@ -44,7 +44,7 @@ set_global("setTimeout", (f, t) => {
|
|||
f();
|
||||
});
|
||||
|
||||
mock_module("muting", {
|
||||
mock_esm("../../static/js/muting", {
|
||||
is_topic_muted: () => false,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const message_list = mock_module("message_list");
|
||||
const message_list = mock_esm("../../static/js/message_list");
|
||||
|
||||
const {Filter} = zrequire("../js/filter");
|
||||
const {MessageListData} = zrequire("../js/message_list_data");
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const message_store = mock_module("message_store");
|
||||
mock_module("muting", {
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
mock_esm("../../static/js/muting", {
|
||||
is_topic_muted: () => false,
|
||||
});
|
||||
set_global("page_params", {});
|
||||
|
|
|
@ -6,10 +6,10 @@ const {parseISO} = require("date-fns");
|
|||
const _ = require("lodash");
|
||||
const MockDate = require("mockdate");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const message_store = mock_module("message_store");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
const people = zrequire("people");
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const reload_state = mock_module("reload_state", {
|
||||
const reload_state = mock_esm("../../static/js/reload_state", {
|
||||
is_in_progress: () => false,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,22 +2,22 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const pm_list_dom = mock_module("pm_list_dom");
|
||||
const unread = mock_module("unread");
|
||||
const unread_ui = mock_module("unread_ui");
|
||||
const vdom = mock_module("vdom", {
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
const pm_list_dom = mock_esm("../../static/js/pm_list_dom");
|
||||
const unread = mock_esm("../../static/js/unread");
|
||||
const unread_ui = mock_esm("../../static/js/unread_ui");
|
||||
const vdom = mock_esm("../../static/js/vdom", {
|
||||
render: () => "fake-dom-for-pm-list",
|
||||
});
|
||||
|
||||
mock_module("stream_popover", {
|
||||
mock_esm("../../static/js/stream_popover", {
|
||||
hide_topic_popover() {},
|
||||
});
|
||||
mock_module("ui", {
|
||||
mock_esm("../../static/js/ui", {
|
||||
get_content_element: (element) => element,
|
||||
});
|
||||
|
||||
|
|
|
@ -3,21 +3,21 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const noop = function () {};
|
||||
|
||||
const rows = mock_module("rows");
|
||||
const stream_data = mock_module("stream_data");
|
||||
mock_module("emoji_picker", {
|
||||
const rows = mock_esm("../../static/js/rows");
|
||||
const stream_data = mock_esm("../../static/js/stream_data");
|
||||
mock_esm("../../static/js/emoji_picker", {
|
||||
hide_emoji_popover: noop,
|
||||
});
|
||||
mock_module("message_viewport", {
|
||||
mock_esm("../../static/js/message_viewport", {
|
||||
height: () => 500,
|
||||
});
|
||||
mock_module("stream_popover", {
|
||||
mock_esm("../../static/js/stream_popover", {
|
||||
hide_stream_popover: noop,
|
||||
hide_topic_popover: noop,
|
||||
hide_all_messages_popover: noop,
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const reload_state = mock_module("reload_state", {
|
||||
const reload_state = mock_esm("../../static/js/reload_state", {
|
||||
is_in_progress: () => false,
|
||||
});
|
||||
const server_events = mock_module("server_events");
|
||||
const server_events = mock_esm("../../static/js/server_events");
|
||||
|
||||
const people = zrequire("people");
|
||||
const presence = zrequire("presence");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
@ -37,11 +37,11 @@ const sample_message = {
|
|||
],
|
||||
};
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const emoji_picker = mock_module("emoji_picker", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const emoji_picker = mock_esm("../../static/js/emoji_picker", {
|
||||
hide_emoji_popover() {},
|
||||
});
|
||||
const message_store = mock_module("message_store");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
|
||||
set_global("current_msg_list", {
|
||||
selected_message() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
let next_id = 0;
|
||||
|
@ -23,14 +23,14 @@ function make_stream_message({stream_id, topic, sender_id}) {
|
|||
return message;
|
||||
}
|
||||
|
||||
const message_list = mock_module("message_list", {
|
||||
const message_list = mock_esm("../../static/js/message_list", {
|
||||
all: {
|
||||
all_messages() {
|
||||
return Array.from(messages.values());
|
||||
},
|
||||
},
|
||||
});
|
||||
mock_module("message_store", {
|
||||
mock_esm("../../static/js/message_store", {
|
||||
get: (message_id) => messages.get(message_id),
|
||||
});
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -36,14 +36,14 @@ const topic8 = "topic-8";
|
|||
const topic9 = "topic-9";
|
||||
const topic10 = "topic-10";
|
||||
|
||||
const message_list = mock_module("message_list", {
|
||||
const message_list = mock_esm("../../static/js/message_list", {
|
||||
all: {
|
||||
all_messages() {
|
||||
return messages;
|
||||
},
|
||||
},
|
||||
});
|
||||
const ListWidget = mock_module("list_widget", {
|
||||
const ListWidget = mock_esm("../../static/js/list_widget", {
|
||||
modifier: noop,
|
||||
|
||||
create: (container, mapped_topic_values, opts) => {
|
||||
|
@ -70,27 +70,27 @@ const ListWidget = mock_module("list_widget", {
|
|||
render_item: (item) => ListWidget.modifier(item),
|
||||
});
|
||||
|
||||
mock_module("compose_actions", {
|
||||
mock_esm("../../static/js/compose_actions", {
|
||||
cancel: noop,
|
||||
});
|
||||
mock_module("drafts", {
|
||||
mock_esm("../../static/js/drafts", {
|
||||
update_draft: noop,
|
||||
});
|
||||
mock_module("hash_util", {
|
||||
mock_esm("../../static/js/hash_util", {
|
||||
by_stream_uri: () => "https://www.example.com",
|
||||
|
||||
by_stream_topic_uri: () => "https://www.example.com",
|
||||
});
|
||||
mock_module("narrow", {
|
||||
mock_esm("../../static/js/narrow", {
|
||||
set_narrow_title: noop,
|
||||
});
|
||||
mock_module("message_store", {
|
||||
mock_esm("../../static/js/message_store", {
|
||||
get: (msg_id) => messages[msg_id - 1],
|
||||
});
|
||||
mock_module("message_view_header", {
|
||||
mock_esm("../../static/js/message_view_header", {
|
||||
render_title_area: noop,
|
||||
});
|
||||
mock_module("muting", {
|
||||
mock_esm("../../static/js/muting", {
|
||||
is_topic_muted: (stream_id, topic) => {
|
||||
if (stream_id === stream1 && topic === topic7) {
|
||||
return true;
|
||||
|
@ -98,10 +98,10 @@ mock_module("muting", {
|
|||
return false;
|
||||
},
|
||||
});
|
||||
mock_module("recent_senders", {
|
||||
mock_esm("../../static/js/recent_senders", {
|
||||
get_topic_recent_senders: () => [1, 2],
|
||||
});
|
||||
mock_module("stream_data", {
|
||||
mock_esm("../../static/js/stream_data", {
|
||||
get_sub_by_id: (stream) => {
|
||||
if (stream === stream5) {
|
||||
// No data is available for deactivated streams
|
||||
|
@ -120,10 +120,10 @@ mock_module("stream_data", {
|
|||
false,
|
||||
id_is_subscribed: () => true,
|
||||
});
|
||||
mock_module("stream_list", {
|
||||
mock_esm("../../static/js/stream_list", {
|
||||
handle_narrow_deactivated: noop,
|
||||
});
|
||||
mock_module("timerender", {
|
||||
mock_esm("../../static/js/timerender", {
|
||||
last_seen_status_from_date: () => "Just now",
|
||||
|
||||
get_full_datetime: () => ({
|
||||
|
@ -131,10 +131,10 @@ mock_module("timerender", {
|
|||
time: "time",
|
||||
}),
|
||||
});
|
||||
mock_module("top_left_corner", {
|
||||
mock_esm("../../static/js/top_left_corner", {
|
||||
narrow_to_recent_topics: noop,
|
||||
});
|
||||
mock_module("unread", {
|
||||
mock_esm("../../static/js/unread", {
|
||||
num_unread_for_topic: (stream_id, topic) => {
|
||||
if (stream_id === 1 && topic === "topic-1") {
|
||||
// Only stream1, topic-1 is read.
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
mock_module("rtl", {
|
||||
mock_esm("../../static/js/rtl", {
|
||||
get_direction: () => "ltr",
|
||||
});
|
||||
const page_params = set_global("page_params", {emojiset: "apple"});
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
mock_module("ui", {
|
||||
mock_esm("../../static/js/ui", {
|
||||
get_scroll_element: (element) => element,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,24 +2,24 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const narrow = mock_module("narrow");
|
||||
const narrow_state = mock_module("narrow_state", {
|
||||
const narrow = mock_esm("../../static/js/narrow");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state", {
|
||||
filter: () => false,
|
||||
});
|
||||
const search_suggestion = mock_module("search_suggestion");
|
||||
const search_suggestion = mock_esm("../../static/js/search_suggestion");
|
||||
|
||||
mock_module("search_pill_widget", {
|
||||
mock_esm("../../static/js/search_pill_widget", {
|
||||
widget: {
|
||||
getByID: () => true,
|
||||
},
|
||||
});
|
||||
mock_module("ui_util", {
|
||||
mock_esm("../../static/js/ui_util", {
|
||||
change_tab_to: noop,
|
||||
place_caret_at_end: noop,
|
||||
});
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -12,16 +12,16 @@ set_global("page_params", {
|
|||
|
||||
const noop = () => {};
|
||||
|
||||
const narrow = mock_module("narrow");
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const search_suggestion = mock_module("search_suggestion");
|
||||
mock_module("ui_util", {
|
||||
const narrow = mock_esm("../../static/js/narrow");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
const search_suggestion = mock_esm("../../static/js/search_suggestion");
|
||||
mock_esm("../../static/js/ui_util", {
|
||||
change_tab_to: noop,
|
||||
});
|
||||
|
||||
const Filter = {};
|
||||
|
||||
mock_module("filter", {
|
||||
mock_esm("../../static/js/filter", {
|
||||
Filter,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,14 +2,14 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const page_params = set_global("page_params", {
|
||||
search_pills_enabled: true,
|
||||
});
|
||||
|
||||
mock_module("message_store", {
|
||||
mock_esm("../../static/js/message_store", {
|
||||
user_ids: () => [],
|
||||
});
|
||||
|
||||
|
|
|
@ -2,13 +2,13 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const page_params = set_global("page_params", {
|
||||
search_pills_enabled: false,
|
||||
});
|
||||
mock_module("message_store", {
|
||||
mock_esm("../../static/js/message_store", {
|
||||
user_ids: () => [],
|
||||
});
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const noop = () => {};
|
||||
|
@ -16,8 +16,8 @@ set_global("document", {
|
|||
});
|
||||
set_global("addEventListener", noop);
|
||||
|
||||
const channel = mock_module("channel");
|
||||
mock_module("reload_state", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
mock_esm("../../static/js/reload_state", {
|
||||
is_in_progress() {
|
||||
return false;
|
||||
},
|
||||
|
@ -33,7 +33,7 @@ set_global("page_params", {test_suite: false});
|
|||
// we also directly write to pointer
|
||||
set_global("pointer", {});
|
||||
|
||||
mock_module("ui_report", {
|
||||
mock_esm("../../static/js/ui_report", {
|
||||
hide_error() {
|
||||
return false;
|
||||
},
|
||||
|
@ -42,13 +42,13 @@ mock_module("ui_report", {
|
|||
},
|
||||
});
|
||||
|
||||
mock_module("stream_events", {
|
||||
mock_esm("../../static/js/stream_events", {
|
||||
update_property() {
|
||||
throw new Error("subs update error");
|
||||
},
|
||||
});
|
||||
|
||||
const message_events = mock_module("message_events", {
|
||||
const message_events = mock_esm("../../static/js/message_events", {
|
||||
insert_new_messages() {
|
||||
throw new Error("insert error");
|
||||
},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -27,7 +27,7 @@ const bot_data_params = {
|
|||
],
|
||||
};
|
||||
|
||||
const avatar = mock_module("avatar");
|
||||
const avatar = mock_esm("../../static/js/avatar");
|
||||
function ClipboardJS(sel) {
|
||||
assert.equal(sel, "#copy_zuliprc");
|
||||
}
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const upload_widget = mock_module("upload_widget");
|
||||
const upload_widget = mock_esm("../../static/js/upload_widget");
|
||||
const settings_emoji = zrequire("settings_emoji");
|
||||
|
||||
run_test("build_emoji_upload_widget", () => {
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const muting_ui = mock_module("muting_ui");
|
||||
const muting_ui = mock_esm("../../static/js/muting_ui");
|
||||
|
||||
const settings_muting = zrequire("settings_muting");
|
||||
const stream_data = zrequire("stream_data");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -32,7 +32,7 @@ const page_params = set_global("page_params", {
|
|||
realm_authentication_methods: {},
|
||||
});
|
||||
|
||||
const realm_icon = mock_module("realm_icon");
|
||||
const realm_icon = mock_esm("../../static/js/realm_icon");
|
||||
|
||||
stub_templates((name, data) => {
|
||||
if (name === "settings/admin_realm_domains_list") {
|
||||
|
@ -42,17 +42,17 @@ stub_templates((name, data) => {
|
|||
throw new Error(`Unknown template ${name}`);
|
||||
});
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const overlays = mock_module("overlays");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const overlays = mock_esm("../../static/js/overlays");
|
||||
|
||||
mock_module("list_widget", {
|
||||
mock_esm("../../static/js/list_widget", {
|
||||
create: () => ({init: noop}),
|
||||
});
|
||||
mock_module("loading", {
|
||||
mock_esm("../../static/js/loading", {
|
||||
make_indicator: noop,
|
||||
destroy_indicator: noop,
|
||||
});
|
||||
mock_module("ui_report", {
|
||||
mock_esm("../../static/js/ui_report", {
|
||||
success(msg, elem) {
|
||||
elem.val(msg);
|
||||
},
|
||||
|
|
|
@ -3,11 +3,11 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const loading = mock_module("loading");
|
||||
const loading = mock_esm("../../static/js/loading");
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
const SHORT_TEXT_ID = 1;
|
||||
|
|
|
@ -5,7 +5,7 @@ const {strict: assert} = require("assert");
|
|||
const _ = require("lodash");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -17,16 +17,16 @@ const pills = {
|
|||
|
||||
let create_item_handler;
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const confirm_dialog = mock_module("confirm_dialog");
|
||||
const input_pill = mock_module("input_pill");
|
||||
const typeahead_helper = mock_module("typeahead_helper");
|
||||
const user_groups = mock_module("user_groups", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const confirm_dialog = mock_esm("../../static/js/confirm_dialog");
|
||||
const input_pill = mock_esm("../../static/js/input_pill");
|
||||
const typeahead_helper = mock_esm("../../static/js/typeahead_helper");
|
||||
const user_groups = mock_esm("../../static/js/user_groups", {
|
||||
get_user_group_from_id: noop,
|
||||
remove: noop,
|
||||
add: noop,
|
||||
});
|
||||
const ui_report = mock_module("ui_report");
|
||||
const ui_report = mock_esm("../../static/js/ui_report");
|
||||
|
||||
const page_params = set_global("page_params", {});
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -11,23 +11,23 @@ const noop = () => {};
|
|||
stub_templates(() => noop);
|
||||
|
||||
const page_params = set_global("page_params", {});
|
||||
const typeahead_helper = mock_module("typeahead_helper");
|
||||
const ui = mock_module("ui", {
|
||||
const typeahead_helper = mock_esm("../../static/js/typeahead_helper");
|
||||
const ui = mock_esm("../../static/js/ui", {
|
||||
get_scroll_element: noop,
|
||||
});
|
||||
|
||||
mock_module("hash_util", {
|
||||
mock_esm("../../static/js/hash_util", {
|
||||
stream_edit_uri: noop,
|
||||
by_stream_uri: noop,
|
||||
});
|
||||
mock_module("hashchange", {update_browser_history: noop});
|
||||
mock_module("list_widget", {
|
||||
mock_esm("../../static/js/hashchange", {update_browser_history: noop});
|
||||
mock_esm("../../static/js/list_widget", {
|
||||
create: () => ({init: noop}),
|
||||
});
|
||||
mock_module("settings_notifications", {
|
||||
mock_esm("../../static/js/settings_notifications", {
|
||||
get_notifications_table_row_data: noop,
|
||||
});
|
||||
mock_module("stream_color", {
|
||||
mock_esm("../../static/js/stream_color", {
|
||||
set_colorpicker_color: noop,
|
||||
});
|
||||
|
||||
|
|
|
@ -2,37 +2,37 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const noop = () => {};
|
||||
const color_data = mock_module("color_data");
|
||||
const message_util = mock_module("message_util");
|
||||
const stream_color = mock_module("stream_color");
|
||||
const stream_list = mock_module("stream_list");
|
||||
const stream_muting = mock_module("stream_muting");
|
||||
const subs = mock_module("subs", {
|
||||
const color_data = mock_esm("../../static/js/color_data");
|
||||
const message_util = mock_esm("../../static/js/message_util");
|
||||
const stream_color = mock_esm("../../static/js/stream_color");
|
||||
const stream_list = mock_esm("../../static/js/stream_list");
|
||||
const stream_muting = mock_esm("../../static/js/stream_muting");
|
||||
const subs = mock_esm("../../static/js/subs", {
|
||||
update_settings_for_subscribed: noop,
|
||||
});
|
||||
|
||||
mock_module("message_list", {
|
||||
mock_esm("../../static/js/message_list", {
|
||||
all: {
|
||||
all_messages() {
|
||||
return ["msg"];
|
||||
},
|
||||
},
|
||||
});
|
||||
mock_module("recent_topics", {
|
||||
mock_esm("../../static/js/recent_topics", {
|
||||
complete_rerender: () => {},
|
||||
});
|
||||
mock_module("settings_notifications", {
|
||||
mock_esm("../../static/js/settings_notifications", {
|
||||
update_page: () => {},
|
||||
});
|
||||
set_global("current_msg_list", {});
|
||||
|
||||
mock_module("overlays", {streams_open: () => true});
|
||||
mock_esm("../../static/js/overlays", {streams_open: () => true});
|
||||
|
||||
const {Filter} = zrequire("../js/filter");
|
||||
const message_view_header = zrequire("message_view_header");
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -16,12 +16,12 @@ const page_params = set_global("page_params", {
|
|||
|
||||
const noop = () => {};
|
||||
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const topic_list = mock_module("topic_list");
|
||||
mock_module("keydown_util", {
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
const topic_list = mock_esm("../../static/js/topic_list");
|
||||
mock_esm("../../static/js/keydown_util", {
|
||||
handle: noop,
|
||||
});
|
||||
mock_module("ui", {get_scroll_element: (element) => element});
|
||||
mock_esm("../../static/js/ui", {get_scroll_element: (element) => element});
|
||||
|
||||
const {Filter} = zrequire("../js/filter");
|
||||
const stream_sort = zrequire("stream_sort");
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -11,14 +11,14 @@ const $ = require("../zjsunit/zjquery");
|
|||
|
||||
const noop = () => {};
|
||||
|
||||
mock_module("resize", {
|
||||
mock_esm("../../static/js/resize", {
|
||||
resize_page_components: noop,
|
||||
|
||||
resize_stream_filters_container: noop,
|
||||
});
|
||||
|
||||
const popovers = mock_module("popovers");
|
||||
const stream_popover = mock_module("stream_popover");
|
||||
const popovers = mock_esm("../../static/js/popovers");
|
||||
const stream_popover = mock_esm("../../static/js/stream_popover");
|
||||
|
||||
const stream_list = zrequire("stream_list");
|
||||
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const message_list = mock_module("message_list");
|
||||
const message_util = mock_module("message_util");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const message_list = mock_esm("../../static/js/message_list");
|
||||
const message_util = mock_esm("../../static/js/message_util");
|
||||
|
||||
const unread = zrequire("unread");
|
||||
const stream_data = zrequire("stream_data");
|
||||
|
|
|
@ -2,12 +2,12 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const message_store = mock_module("message_store");
|
||||
const widgetize = mock_module("widgetize");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const message_store = mock_esm("../../static/js/message_store");
|
||||
const widgetize = mock_esm("../../static/js/widgetize");
|
||||
|
||||
const submessage = zrequire("submessage");
|
||||
|
||||
|
|
|
@ -3,13 +3,13 @@
|
|||
const {strict: assert} = require("assert");
|
||||
|
||||
const {stub_templates} = require("../zjsunit/handlebars");
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const denmark_stream_id = 101;
|
||||
|
||||
const ui = mock_module("ui", {
|
||||
const ui = mock_esm("../../static/js/ui", {
|
||||
get_content_element: (element) => element,
|
||||
get_scroll_element: (element) => element,
|
||||
});
|
||||
|
@ -17,7 +17,7 @@ const ui = mock_module("ui", {
|
|||
set_global("location", {
|
||||
hash: `#streams/${denmark_stream_id}/announce`,
|
||||
});
|
||||
mock_module("hash_util", {
|
||||
mock_esm("../../static/js/hash_util", {
|
||||
by_stream_uri: () => {},
|
||||
});
|
||||
set_global("page_params", {});
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
mock_module("resize", {
|
||||
mock_esm("../../static/js/resize", {
|
||||
resize_stream_filters_container: () => {},
|
||||
});
|
||||
const {Filter} = zrequire("../js/filter");
|
||||
|
|
|
@ -4,15 +4,15 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const muting = mock_module("muting", {
|
||||
const muting = mock_esm("../../static/js/muting", {
|
||||
is_topic_muted() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
const narrow_state = mock_module("narrow_state", {
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state", {
|
||||
topic() {},
|
||||
});
|
||||
|
||||
|
|
|
@ -2,16 +2,16 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
const page_params = set_global("page_params", {});
|
||||
const channel = mock_module("channel");
|
||||
const reload = mock_module("reload");
|
||||
const reload_state = mock_module("reload_state");
|
||||
const sent_messages = mock_module("sent_messages", {
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const reload = mock_esm("../../static/js/reload");
|
||||
const reload_state = mock_esm("../../static/js/reload_state");
|
||||
const sent_messages = mock_esm("../../static/js/sent_messages", {
|
||||
start_tracking_message: noop,
|
||||
report_server_ack: noop,
|
||||
});
|
||||
|
|
|
@ -9,13 +9,7 @@
|
|||
// become clear as you keep reading.
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {
|
||||
mock_module,
|
||||
set_global,
|
||||
unmock_module,
|
||||
with_field,
|
||||
zrequire,
|
||||
} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, unmock_module, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {make_stub} = require("../zjsunit/stub");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
|
@ -23,23 +17,23 @@ const {run_test} = require("../zjsunit/test");
|
|||
// structure that the server sends down to us when the app starts. We
|
||||
// prefer to test with a clean slate.
|
||||
|
||||
const activity = mock_module("activity");
|
||||
const channel = mock_module("channel");
|
||||
const activity = mock_esm("../../static/js/activity");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const home_msg_list = set_global("home_msg_list", {});
|
||||
const message_list = mock_module("message_list");
|
||||
const message_live_update = mock_module("message_live_update");
|
||||
const message_util = mock_module("message_util");
|
||||
const message_viewport = mock_module("message_viewport");
|
||||
const notifications = mock_module("notifications");
|
||||
const overlays = mock_module("overlays");
|
||||
const pm_list = mock_module("pm_list");
|
||||
const resize = mock_module("resize");
|
||||
const settings_users = mock_module("settings_users");
|
||||
const topic_list = mock_module("topic_list");
|
||||
const unread_ui = mock_module("unread_ui");
|
||||
const message_list = mock_esm("../../static/js/message_list");
|
||||
const message_live_update = mock_esm("../../static/js/message_live_update");
|
||||
const message_util = mock_esm("../../static/js/message_util");
|
||||
const message_viewport = mock_esm("../../static/js/message_viewport");
|
||||
const notifications = mock_esm("../../static/js/notifications");
|
||||
const overlays = mock_esm("../../static/js/overlays");
|
||||
const pm_list = mock_esm("../../static/js/pm_list");
|
||||
const resize = mock_esm("../../static/js/resize");
|
||||
const settings_users = mock_esm("../../static/js/settings_users");
|
||||
const topic_list = mock_esm("../../static/js/topic_list");
|
||||
const unread_ui = mock_esm("../../static/js/unread_ui");
|
||||
|
||||
let stream_list = mock_module("stream_list");
|
||||
let unread_ops = mock_module("unread_ops");
|
||||
let stream_list = mock_esm("../../static/js/stream_list");
|
||||
let unread_ops = mock_esm("../../static/js/unread_ops");
|
||||
|
||||
set_global("page_params", {});
|
||||
|
||||
|
@ -587,7 +581,7 @@ run_test("explore make_stub", (override) => {
|
|||
|
||||
*/
|
||||
|
||||
unmock_module("unread_ops");
|
||||
unmock_module("../../static/js/unread_ops");
|
||||
unread_ops = zrequire("unread_ops");
|
||||
|
||||
run_test("unread_ops", (override) => {
|
||||
|
@ -686,7 +680,7 @@ run_test("unread_ops", (override) => {
|
|||
|
||||
*/
|
||||
|
||||
unmock_module("stream_list");
|
||||
unmock_module("../../static/js/stream_list");
|
||||
stream_list = zrequire("stream_list");
|
||||
|
||||
const social_stream = {
|
||||
|
|
|
@ -4,14 +4,14 @@ const {strict: assert} = require("assert");
|
|||
|
||||
const _ = require("lodash");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
let page_params = set_global("page_params", {
|
||||
realm_push_notifications_enabled: false,
|
||||
});
|
||||
|
||||
const message_store = mock_module("message_store", {
|
||||
const message_store = mock_esm("../../static/js/message_store", {
|
||||
get() {},
|
||||
});
|
||||
const muting = zrequire("muting");
|
||||
|
|
|
@ -2,43 +2,43 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const message_live_update = mock_module("message_live_update");
|
||||
const settings_account = mock_module("settings_account", {
|
||||
const message_live_update = mock_esm("../../static/js/message_live_update");
|
||||
const settings_account = mock_esm("../../static/js/settings_account", {
|
||||
update_email() {},
|
||||
update_full_name() {},
|
||||
});
|
||||
|
||||
mock_module("activity", {
|
||||
mock_esm("../../static/js/activity", {
|
||||
redraw() {},
|
||||
});
|
||||
mock_module("compose", {
|
||||
mock_esm("../../static/js/compose", {
|
||||
update_email() {},
|
||||
});
|
||||
mock_module("gear_menu", {
|
||||
mock_esm("../../static/js/gear_menu", {
|
||||
update_org_settings_menu_item() {},
|
||||
});
|
||||
mock_module("narrow_state", {
|
||||
mock_esm("../../static/js/narrow_state", {
|
||||
update_email() {},
|
||||
});
|
||||
mock_module("pm_list", {
|
||||
mock_esm("../../static/js/pm_list", {
|
||||
update_private_messages() {},
|
||||
});
|
||||
mock_module("settings_linkifiers", {
|
||||
mock_esm("../../static/js/settings_linkifiers", {
|
||||
maybe_disable_widgets() {},
|
||||
});
|
||||
mock_module("settings_org", {
|
||||
mock_esm("../../static/js/settings_org", {
|
||||
maybe_disable_widgets() {},
|
||||
});
|
||||
mock_module("settings_profile_fields", {
|
||||
mock_esm("../../static/js/settings_profile_fields", {
|
||||
maybe_disable_widgets() {},
|
||||
});
|
||||
mock_module("settings_streams", {
|
||||
mock_esm("../../static/js/settings_streams", {
|
||||
maybe_disable_widgets() {},
|
||||
});
|
||||
mock_module("settings_users", {
|
||||
mock_esm("../../static/js/settings_users", {
|
||||
update_user_data() {},
|
||||
});
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
|
||||
const channel = mock_module("channel");
|
||||
const channel = mock_esm("../../static/js/channel");
|
||||
const user_status = zrequire("user_status");
|
||||
|
||||
function initialize() {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
const {strict: assert} = require("assert");
|
||||
|
||||
const {mock_module, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {mock_esm, set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
|
@ -36,7 +36,7 @@ const events = [
|
|||
let widget_elem;
|
||||
let is_event_handled;
|
||||
let is_widget_activated;
|
||||
mock_module("poll_widget", {
|
||||
mock_esm("../../static/js/poll_widget", {
|
||||
activate(data) {
|
||||
is_widget_activated = true;
|
||||
widget_elem = data.elem;
|
||||
|
@ -52,7 +52,7 @@ mock_module("poll_widget", {
|
|||
});
|
||||
set_global("document", "document-stub");
|
||||
|
||||
const narrow_state = mock_module("narrow_state");
|
||||
const narrow_state = mock_esm("../../static/js/narrow_state");
|
||||
set_global("current_msg_list", {});
|
||||
|
||||
const widgetize = zrequire("widgetize");
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
const Module = require("module");
|
||||
const path = require("path");
|
||||
|
||||
const callsites = require("callsites");
|
||||
|
||||
const new_globals = new Set();
|
||||
let old_globals = {};
|
||||
|
||||
|
@ -28,23 +30,16 @@ exports.start = () => {
|
|||
Module._load = load;
|
||||
};
|
||||
|
||||
exports.mock_module = (short_fn, obj) => {
|
||||
if (obj === undefined) {
|
||||
obj = {};
|
||||
}
|
||||
|
||||
exports.mock_esm = (request, obj = {}) => {
|
||||
if (typeof obj !== "object") {
|
||||
throw new TypeError("We expect you to stub with an object.");
|
||||
throw new TypeError("An ES module must be mocked with an object");
|
||||
}
|
||||
|
||||
if (short_fn.startsWith("/") || short_fn.includes(".")) {
|
||||
throw new Error(`
|
||||
There is no need for a path like ${short_fn}.
|
||||
We just assume the file is under static/js.
|
||||
`);
|
||||
}
|
||||
|
||||
const filename = require.resolve(`../../static/js/${short_fn}`);
|
||||
const filename = Module._resolveFilename(
|
||||
request,
|
||||
require.cache[callsites()[1].getFileName()],
|
||||
false,
|
||||
);
|
||||
|
||||
if (module_mocks.has(filename)) {
|
||||
throw new Error(`You already set up a mock for ${filename}`);
|
||||
|
@ -59,8 +54,12 @@ exports.mock_module = (short_fn, obj) => {
|
|||
return obj;
|
||||
};
|
||||
|
||||
exports.unmock_module = (short_fn) => {
|
||||
const filename = require.resolve(`../../static/js/${short_fn}`);
|
||||
exports.unmock_module = (request) => {
|
||||
const filename = Module._resolveFilename(
|
||||
request,
|
||||
require.cache[callsites()[1].getFileName()],
|
||||
false,
|
||||
);
|
||||
|
||||
if (!module_mocks.has(filename)) {
|
||||
throw new Error(`Cannot unmock ${filename}, which was not mocked`);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
"babel-loader": "^8.0.6",
|
||||
"blueimp-md5": "^2.10.0",
|
||||
"cache-loader": "^4.0.0",
|
||||
"callsites": "^3.1.0",
|
||||
"clean-css": "^5.1.0",
|
||||
"clipboard": "^2.0.4",
|
||||
"core-js": "^3.6.5",
|
||||
|
|
|
@ -2740,7 +2740,7 @@ callsites@^2.0.0:
|
|||
resolved "https://registry.yarnpkg.com/callsites/-/callsites-2.0.0.tgz#06eb84f00eea413da86affefacbffb36093b3c50"
|
||||
integrity sha1-BuuE8A7qQT2oav/vrL/7Ngk7PFA=
|
||||
|
||||
callsites@^3.0.0:
|
||||
callsites@^3.0.0, callsites@^3.1.0:
|
||||
version "3.1.0"
|
||||
resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73"
|
||||
integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==
|
||||
|
|
Loading…
Reference in New Issue