mirror of https://github.com/zulip/zulip.git
zjsunit: Move mock clearing to namespace.finish.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
1b58f5a700
commit
59e5e9ba35
|
@ -26,9 +26,6 @@ exports.start = () => {
|
|||
}
|
||||
actual_load = Module._load;
|
||||
Module._load = load;
|
||||
|
||||
module_mocks.clear();
|
||||
used_module_mocks.clear();
|
||||
};
|
||||
|
||||
exports.mock_module = (short_fn, obj) => {
|
||||
|
@ -123,6 +120,8 @@ exports.finish = function () {
|
|||
);
|
||||
}
|
||||
}
|
||||
module_mocks.clear();
|
||||
used_module_mocks.clear();
|
||||
|
||||
for (const path of Object.keys(require.cache)) {
|
||||
if (path.startsWith(staticPath) && !path.startsWith(templatesPath)) {
|
||||
|
|
Loading…
Reference in New Issue