mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-03 21:43:21 +00:00 
			
		
		
		
	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:
		@@ -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: () => {},
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user