-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Endless recursion on circular dependencies #13
Comments
UPDATE: If I use clear-module v3.2.0 it works, but with v4.0.0 it hangs. |
Probably related to ccd516c. You might want the // @omrilotan |
I will issue a pull request this evening |
I have reproduced the issue with the following steps:
const sshpk = require('sshpk');
const clear = require('clear-module');
describe('reproduce this issue', () => {
it('Should not get stuck between Before and After', () => {
console.log('Before');
clear('sshpk');
console.log('After');
})
});
#14 should definitely resolve this issue |
Confirmed fixed for me - thanks! |
Hello,
I have an issue when using clear-module within a Mocha unit test: I get an endless recursion. However if I run it outside of a test I don't.
I have successfully used clear-module in tests before. It looks to be related to:
This works fine:
produces:
However if I run using mocha, it hangs on the call to clearModule:
produces:
When I debug this I can see an endless recursion of clearing the sshpk modules which have a circular reference.
I am using node 12.6.0 and the following lib versions:
The text was updated successfully, but these errors were encountered: