Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

add tests to assert rewiremock compatibility #799

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

boneskull
Copy link

@theKashey
Copy link

theKashey commented May 7, 2019

The only incompatibility with esm I am aware of, was bound to callThought and default export, as long as esm expects __esModules to be a property, not only a value, while other systems (babel/webpack) are not checking details.

It would be better rewrite one test to:

const c = rewiremock.proxy("./c.js", () => {
  rewiremock(() => require('path')).with({
    extname: () => "b"
  });
  rewiremock(() => require('./b.js')).with("c");
});

As long as it's much more complex "inside", mocking Module._load twice - first to resolve name, and then to actually mock. 🙏

@jdalton jdalton force-pushed the master branch 2 times, most recently from 98b1fb7 to a2b7949 Compare May 15, 2019 17:49
@jdalton
Copy link
Member

jdalton commented May 19, 2019

Are the tests supposed to pass? Or fail and show an issue I need to resolve?

@theKashey
Copy link

Unfortunately the are passing.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

3 participants