Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
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 join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants