mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	zjsunit: Move mock clearing to namespace.finish.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
		
				
					committed by
					
						
						Steve Howell
					
				
			
			
				
	
			
			
			
						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)) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user