Open
Description
The package I want to mock uses createRequire
to require, which proxyquire doesn't proxy yet. To workaround, I tried:
proxyquire('./example', {
module: {
createRequire: (filename) => Object.assign((id) => require(id), {
// ...some other stuff like `resolve`
}),
'@global': true,
},
// ... stubs I use
});
But then I found the require
above can't be the mocked one. I wonder if you can support createRequire
and give us a way to access the mocked require
(so that we can mock createRequire
to return a require
with our own properties).
Thanks!
Metadata
Metadata
Assignees
Labels
No labels