mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
node_tests: Remove low-hanging uses of __Rewire__.
When we were preparing the conversion to ES modules in 2019, the primary obstacle was that the Node tests extensively relied on the ability to reach into modules and mutate their CommonJS exports in order to mock things. ES module bindings are not mutable, so in commit173c9cee42we added babel-plugin-rewire-ts as a kludgy transpilation-based workaround for this to unblock the conversion. However, babel-plugin-rewire-ts is slow, buggy, nonstandard, confusing, and unmaintained. It’s incompatible with running our ES modules as native ES modules, and prevents us from taking advantage of modern tools for ES modules. So we want to excise all use of __Rewire__ (and the disallow_rewire, override_rewire helper functions that rely on it) from the tests and remove babel-plugin-rewire-ts. Commits64abdc199eande17ba5260a(#20730) prepared for this by letting us see where __Rewire__ is being used. Now we go through and remove most of the uses that are easy to remove without modifying the production code at all. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
f7f5f7a0b1
commit
c520890f54
@@ -134,7 +134,6 @@ EXEMPT_FILES = make_set(
|
||||
"static/js/realm_playground.js",
|
||||
"static/js/realm_user_settings_defaults.ts",
|
||||
"static/js/recent_topics_ui.js",
|
||||
"static/js/recent_topics_util.js",
|
||||
"static/js/reload.js",
|
||||
"static/js/reminder.js",
|
||||
"static/js/resize.js",
|
||||
|
||||
Reference in New Issue
Block a user