mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 09:45:29 -05:00
Merge branch 'fix-leak-in-smoke-tests'
This commit is contained in:
commit
cdbd7af500
1 changed files with 6 additions and 3 deletions
|
@ -21,9 +21,12 @@ module.exports = HealthCheckController =
|
|||
# be in its parent, when it is loaded by mocha.addFile.
|
||||
path = require.resolve(__dirname + "/../../../../test/smoke/js/SmokeTests.js")
|
||||
smokeTestModule = require.cache[path]
|
||||
parent = smokeTestModule.parent
|
||||
while (idx = parent.children.indexOf(smokeTestModule)) != -1
|
||||
parent.children.splice(idx, 1)
|
||||
if smokeTestModule?
|
||||
parent = smokeTestModule.parent
|
||||
while (idx = parent.children.indexOf(smokeTestModule)) != -1
|
||||
parent.children.splice(idx, 1)
|
||||
else
|
||||
logger.warn {path}, "smokeTestModule not defined"
|
||||
# remove the smokeTest from the module cache
|
||||
delete require.cache[path]
|
||||
|
||||
|
|
Loading…
Reference in a new issue