diff --git a/static/js/setup.js b/static/js/setup.js index fe9489eb16..0b51c2b072 100644 --- a/static/js/setup.js +++ b/static/js/setup.js @@ -36,4 +36,16 @@ $(function () { // zxcvbn.js is pretty big, and is only needed on password change, so load it asynchronously. $.getScript('/static/third/zxcvbn/zxcvbn.js'); } + + if (typeof $ !== 'undefined') { + $.fn.expectOne = function () { + if (blueslip && this.length !== 1) { + blueslip.error("Expected one element in jQuery set, " + this.length + " found"); + } + return this; + }; + } + }); + + diff --git a/static/js/util.js b/static/js/util.js index a80b6d3e10..2f5d1de9f8 100644 --- a/static/js/util.js +++ b/static/js/util.js @@ -241,15 +241,6 @@ exports.enforce_arity = function util_enforce_arity(func) { }; }; -if (typeof $ !== 'undefined') { - $.fn.expectOne = function () { - if (blueslip && this.length !== 1) { - blueslip.error("Expected one element in jQuery set, " + this.length + " found"); - } - return this; - }; -} - exports.execute_early = function (func) { if (page_params.test_suite) { $(document).one('phantom_page_loaded', func); diff --git a/zerver/tests/frontend/node/util.js b/zerver/tests/frontend/node/util.js index 20bcbb7e3d..1d23e6320c 100644 --- a/zerver/tests/frontend/node/util.js +++ b/zerver/tests/frontend/node/util.js @@ -2,8 +2,6 @@ add_dependencies({ util: 'js/util.js' }); -set_global('$', {}); - var util = global.util; (function test_CachedValue() {