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

Verify quibble works with esm #13

Closed
searls opened this issue Aug 11, 2017 · 4 comments
Closed

Verify quibble works with esm #13

searls opened this issue Aug 11, 2017 · 4 comments

Comments

@searls
Copy link
Member

searls commented Aug 11, 2017

So, @jdalton released esm today and it looks super cool!

@Schoonology just raised the point that we should validate that quibble works with esm and figure out why not if it doesn't. There's a chance things will "just work" since we're monkey patching Module._load, but we should test it out!

@novemberborn
Copy link

One problem is that esm exports live bindings through getters. That seems to prevent proper fakes from being returned.

@searls
Copy link
Member Author

searls commented May 21, 2018 via email

@pingortle
Copy link

👋 I've been playing with the combination of esm and testdouble.js on a small project recently, ran into some issues with that combination and wanted to share my findings here.

The bad news is that quibble does not Just Work™ out of the box with esm enabled. The good news is that I think I've found a fairly simple workaround.

Here is an example repository where I've reproduced the issue.

TL;DR add this before your test suite runs to get esm + quibble working together.

require('quibble').ignoreCallsFromThisFile(require.resolve('esm/esm'))

I can submit a PR to update the README with a note about esm support so it's easily discoverable. I would also be interested in adding esm support based on this approach as a baked in feature for quibble.

cc @jasonkarns

@pingortle pingortle mentioned this issue Jan 30, 2019
2 tasks
@searls
Copy link
Member Author

searls commented May 9, 2020

Fixed by #29

@searls searls closed this as completed May 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants