Native .node modules cannot be loaded more than once.
require('./some-lib.node');
delete require('module')._cache[<some-lib's module ID>];
require('./some-lib.node');
// Error: Module did not self-register.
Mockery will have to cache native modules no matter what, so that they're never loaded more than once. They can still be substituted and mocked. The only problem is if a native module require()s some dependencies, but I don't think that happens in practice.
See also: mfncooper#34
Native .node modules cannot be loaded more than once.
Mockery will have to cache native modules no matter what, so that they're never loaded more than once. They can still be substituted and mocked. The only problem is if a native module require()s some dependencies, but I don't think that happens in practice.
See also: mfncooper#34