mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 13:33:24 +00:00
node_tests: Don’t read from most deprecated global variables.
We still need to write to these globals with set_global because the code being tested reads from them, but the tests themselves should never need to read from them. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
@@ -9,9 +9,9 @@ const {make_zjquery} = require("../zjsunit/zjquery");
|
||||
|
||||
set_global("$", make_zjquery());
|
||||
|
||||
zrequire("localstorage");
|
||||
zrequire("drafts");
|
||||
zrequire("timerender");
|
||||
const localstorage = zrequire("localstorage");
|
||||
const drafts = zrequire("drafts");
|
||||
const timerender = zrequire("timerender");
|
||||
zrequire("stream_color");
|
||||
zrequire("colorspace");
|
||||
|
||||
@@ -20,7 +20,7 @@ const noop = function () {
|
||||
return;
|
||||
};
|
||||
|
||||
set_global("localStorage", {
|
||||
const localStorage = set_global("localStorage", {
|
||||
getItem(key) {
|
||||
return ls_container.get(key);
|
||||
},
|
||||
@@ -35,7 +35,7 @@ set_global("localStorage", {
|
||||
},
|
||||
});
|
||||
set_global("compose", {});
|
||||
set_global("compose_state", {});
|
||||
const compose_state = set_global("compose_state", {});
|
||||
set_global("stream_data", {
|
||||
get_color() {
|
||||
return "#FFFFFF";
|
||||
|
||||
Reference in New Issue
Block a user