The documentation should mention how to handle default-export imports. For example, in the following case:
- We want to test the default export
main from main.ts,
main.ts imports the default export importedFunction from importedFunction.ts, and
- We want to stub
importedFunction with importedFunctionStub;
then we need to do this:
const { default: main } = proxyquire<{ default: typeof main }>(
'path/to/main', {
'path/to/importedFunction': { default: importedFunctionStub },
}
);