Hey there!
So I'm having sort of a weird problem. I'm testing a function that reads from a file and does stuff with the contents. I'm using mock-fs and everything is great. However, one of the modules I'm using changed their code so that there are require statements in functions that get called during the test (in my case, an HTTP request). When the mock is active, require('./blah') fails because unless I've mirrored that file (which lives > 3 levels down in node_modules), it's not found. More specific examples are here.
Is it currently possible (or possible to add) an option so that the fs is mocked as normal, but all calls to require are untouched?
Hey there!
So I'm having sort of a weird problem. I'm testing a function that reads from a file and does stuff with the contents. I'm using
mock-fsand everything is great. However, one of the modules I'm using changed their code so that there arerequirestatements in functions that get called during the test (in my case, an HTTP request). When the mock is active,require('./blah')fails because unless I've mirrored that file (which lives > 3 levels down innode_modules), it's not found. More specific examples are here.Is it currently possible (or possible to add) an option so that the fs is mocked as normal, but all calls to
requireare untouched?