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

Cannot mock default and named exports together #60

Open
jPomeranz opened this issue Jul 11, 2018 · 1 comment
Open

Cannot mock default and named exports together #60

jPomeranz opened this issue Jul 11, 2018 · 1 comment
Assignees

Comments

@jPomeranz
Copy link

jPomeranz commented Jul 11, 2018

Repro:
'../path/to/module': { default: someDefaultMock, named: someNamedMock },

This code works with just the default or named modules, however, using both in conjunction causes the default import to fail.

Temporary workaround:
Instead of only using export default on your current default module, export it as both a default and named export, eg named2. Then you can import all your modules as named modules and the imports will work:

'../path/to/module': { named2: someDefaultMock, named: someNamedMock },

@plasticine
Copy link
Owner

Hey, thanks for this, I’ll take a look.

@plasticine plasticine self-assigned this Sep 4, 2018
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

2 participants