Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

zjsunit: Set window with set_global.

Anders Kaseorgd100d67d4caa
diff --git a/frontend_tests/zjsunit/index.js b/frontend_tests/zjsunit/index.js
index b5a6fa5cf0c..4b8e5b43ead 100644
--- a/frontend_tests/zjsunit/index.js
+++ b/frontend_tests/zjsunit/index.js
@@ -35,13 +35,12 @@ if (files.length === 0) {
}
// Set up our namespace helpers.
-global.window = new Proxy(global, {
+const window = new Proxy(global, {
set: (obj, prop, value) => {
namespace.set_global(prop, value);
return true;
},
});
-global.to_$ = () => window;
// Set up Handlebars
handlebars.hook_require();
@@ -77,6 +76,8 @@ test.set_verbose(files.length === 1);
try {
files.forEach((file) => {
+ namespace.set_global("window", window);
+ namespace.set_global("to_$", () => window);
namespace.set_global("location", {
hash: "#",
});