diff --git a/frontend_tests/node_tests/list_render.js b/frontend_tests/node_tests/list_render.js index 5d97dd98e9..a183ed24df 100644 --- a/frontend_tests/node_tests/list_render.js +++ b/frontend_tests/node_tests/list_render.js @@ -6,9 +6,10 @@ zrequire('list_render'); // that are either jQuery, Element, or just raw HTML // strings. We initially test with raw strings. set_global('jQuery', 'stub'); -set_global('Element', function () { +function Element() { return { }; -}); +} +set_global('Element', Element); // We only need very simple jQuery wrappers for when the // "real" code wraps html or sets up click handlers. diff --git a/frontend_tests/node_tests/markdown.js b/frontend_tests/node_tests/markdown.js index 67c580c5a0..a763cc4c5b 100644 --- a/frontend_tests/node_tests/markdown.js +++ b/frontend_tests/node_tests/markdown.js @@ -44,9 +44,10 @@ set_global('page_params', { translate_emoticons: false, }); -set_global('Image', function () { +function Image() { return {}; -}); +} +set_global('Image', Image); emoji.initialize(); const doc = ""; diff --git a/frontend_tests/node_tests/message_fetch.js b/frontend_tests/node_tests/message_fetch.js index 6d1a32ca58..20ad12d099 100644 --- a/frontend_tests/node_tests/message_fetch.js +++ b/frontend_tests/node_tests/message_fetch.js @@ -5,7 +5,10 @@ zrequire('message_fetch'); const noop = () => {}; -set_global('MessageListView', function () { return {}; }); +function MessageListView() { + return {}; +} +set_global('MessageListView', MessageListView); zrequire('FetchStatus', 'js/fetch_status'); zrequire('Filter', 'js/filter'); diff --git a/frontend_tests/node_tests/popovers.js b/frontend_tests/node_tests/popovers.js index 02e7b24d59..e9e12bbce5 100644 --- a/frontend_tests/node_tests/popovers.js +++ b/frontend_tests/node_tests/popovers.js @@ -42,9 +42,10 @@ set_global('stream_popover', { set_global('stream_data', {}); -set_global('ClipboardJS', function (sel) { +function ClipboardJS(sel) { assert.equal(sel, '.copy_link'); -}); +} +set_global('ClipboardJS', ClipboardJS); const alice = { email: 'alice@example.com', @@ -95,9 +96,7 @@ function make_image_stubber() { return image; } - set_global('Image', function () { - return stub_image(); - }); + set_global('Image', stub_image); return { get: (i) => images[i], diff --git a/frontend_tests/node_tests/presence.js b/frontend_tests/node_tests/presence.js index bb2e584e54..c1d508b22b 100644 --- a/frontend_tests/node_tests/presence.js +++ b/frontend_tests/node_tests/presence.js @@ -7,7 +7,10 @@ set_global('server_events', {}); set_global('reload_state', { is_in_progress: return_false, }); -set_global('XDate', function (ms) { return {seconds: ms}; }); +function XDate(ms) { + return {seconds: ms}; +} +set_global('XDate', XDate); const OFFLINE_THRESHOLD_SECS = 140; diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js index cc6e9b6f79..1d8b83b3fb 100644 --- a/frontend_tests/node_tests/settings_bots.js +++ b/frontend_tests/node_tests/settings_bots.js @@ -24,9 +24,10 @@ zrequire('bot_data'); zrequire('settings_bots'); zrequire('people'); -set_global('ClipboardJS', function (sel) { +function ClipboardJS(sel) { assert.equal(sel, '#copy_zuliprc'); -}); +} +set_global('ClipboardJS', ClipboardJS); bot_data.initialize(bot_data_params);