zjsunit: Lift restriction against mocking third party modules.

Use fully resolvable request paths because we need to be able to refer
to third party modules, and to increase uniformity and explicitness.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg
2021-03-09 21:10:32 -08:00
parent 87a3650176
commit 876806eb4d
76 changed files with 436 additions and 442 deletions

View File

@@ -2,13 +2,13 @@
const {strict: assert} = require("assert");
const {mock_module, set_global, with_field, zrequire} = require("../zjsunit/namespace");
const {mock_esm, set_global, with_field, zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
const channel = mock_module("channel");
const ui = mock_module("ui");
const channel = mock_esm("../../static/js/channel");
const ui = mock_esm("../../static/js/ui");
mock_module("starred_messages", {
mock_esm("../../static/js/starred_messages", {
add: () => {},
remove: () => {},