I'm trying to use rewiremock after converting from using rewire in a typescript project.
// ./rewiremock.ts
import rewiremock, {addPlugin, plugins} from 'rewiremock'
rewiremock.overrideEntryPoint(module) // this is important. This command is "transfering" this module parent to rewiremock
addPlugin(plugins.nodejs)
// we need webpack aliases
addPlugin(plugins.webpackAlias)
// and all stub names would be a relative
addPlugin(plugins.relative)
// and all stubs should be used. Lets make it default!
addPlugin(plugins.usedByDefault)
export { rewiremock }
// ./test/demo.test.ts
import { rewiremock } from '../rewiremock'
Even just importing is enough for the error to occur.
I'm trying to use
rewiremock
after converting from usingrewire
in a typescript project.Even just importing is enough for the error to occur.