Closed SimenB closed 4 years ago
The current check looks for a Symbol (or a string on older nodes) on global, which fails when the module is evaluated in different contexts, like what Jest does.
Symbol
global
I've put together a repository which is too small to really show the leak, but it illustrates what the issue is: https://github.com/SimenB/graceful-fs-jest-memleak
If we just log when fs is patched, this is the result:
fs
If we add the queue to fs instead of global, this is the result:
Cannot upvote enough!
The current check looks for a
Symbol
(or a string on older nodes) onglobal
, which fails when the module is evaluated in different contexts, like what Jest does.I've put together a repository which is too small to really show the leak, but it illustrates what the issue is: https://github.com/SimenB/graceful-fs-jest-memleak
If we just log when
fs
is patched, this is the result:If we add the queue to
fs
instead ofglobal
, this is the result: