I have some runtime importable module imports via AMD define. Everything is working as expected but I just cannot mock any runtime module inside the tests.
Error message without mocks: Cannot find module 'MyModule' from ...
I also get the same error message when I try to jest.mock the module. just the error happens inside the test file then.
// globals.d.ts
declare module 'config' {
const val: IConfig;
export default val;
}
// main.ts
/// <reference path="./globals.d.ts" />
import config from 'config';
[...]
// main.spec.ts
import { main } from "./main.ts"
[...]