mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 13:03:29 +00:00
zjquery: Make zjquery a singleton.
We no longer export make_zjquery().
We now instead have a singleton zjquery instance
that we attach to global.$ in index.js.
We call $.clear_all_elements() before each module.
(We will soon get even more aggressive about doing
it in run_test.)
Test functions can still override $ with set_global.
A good example of this is copy_and_paste using the
real jquery module.
We no longer exempt $ as a global variable, so
test modules that use the zjquery $ need to do:
const $ = require("../zjsunit/zjquery");
This commit is contained in:
committed by
Steve Howell
parent
2e3406f0b8
commit
64c7eb67eb
@@ -4,9 +4,7 @@ const {strict: assert} = require("assert");
|
||||
|
||||
const {set_global, with_field, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const {make_zjquery} = require("../zjsunit/zjquery");
|
||||
|
||||
set_global("$", make_zjquery());
|
||||
const $ = require("../zjsunit/zjquery");
|
||||
|
||||
const narrow_state = set_global("narrow_state", {});
|
||||
set_global("ui", {
|
||||
|
||||
Reference in New Issue
Block a user