theKashey/rewiremock

nodejs v18.3.0 Error: Rewiremock: there is no "parent module". Is there two HotModuleReplacementPlugins?

Kreijstal opened this issue · 4 comments

can I use rewiremock in native node?
await import("rewiremock"); in the repl throws the error in the title. I am not using any transpiler, simply using native node repl

Probably this is due ESM becoming the "native" mode.
I need to check if rewiremock can exists in the new world (it is not native ESM compatible)

Have you had an opportunity to check this out yet?

Well, yes. It's not native module compatible as it missing a part("loader") required to modify ESM behaviour and make them mockable. Basically, the requirement is to implement an old module system inside new module system.
Not something I can afford doing 😢