mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
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:
committed by
Tim Abbott
parent
615b7fcc2c
commit
960174408f
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user