rewiremock: Use with "esm" and .mjs files does not work

Hello, I’m unsure how to use this mocking together with mocha, esm and a .mjs file.

I built a reproducible test repo here: https://github.com/onlywei/rewiremock-esm-repro

I’ve also tried turning on esm’s cjs-interop flag and got a different error. Would like advice.

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

That’s awesome way to tackle the problem. How I will all issues will be as easily reproducible as this one.