frontend_tests: Use named functions to mock constructors.

This will stop ESLint from replacing them with arrow functions, which
cannot be constructors.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2020-07-01 16:55:18 -07:00
committed by Tim Abbott
parent 615b7fcc2c
commit 960174408f
6 changed files with 21 additions and 13 deletions

View File

@@ -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.