mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-11-01 18:47:51 +00:00
tests: mocklib: prevent caching modules loaded by mocklib.require()
This is needed to ensure that subsequent wrapped require() calls (re)load the mock modules instead of reusing the cached real module instances. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
committed by
John Crispin
parent
184226532d
commit
2fb97d5436
@@ -179,6 +179,7 @@ global.mocklib = {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
res = require(module);
|
res = require(module);
|
||||||
|
delete global.modules[module];
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
ex = e;
|
ex = e;
|
||||||
|
|||||||
Reference in New Issue
Block a user