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

What does "Error: Failed to get mock metadata" mean? #678

Closed
Pinwheeler opened this issue Jan 18, 2016 · 7 comments · Fixed by #13513
Closed

What does "Error: Failed to get mock metadata" mean? #678

Pinwheeler opened this issue Jan 18, 2016 · 7 comments · Fixed by #13513

Comments

@Pinwheeler
Copy link

I'm having an error running Jest and would like to get you a simple test case slice as per your guidelines, but am having trouble reproducing it in anything other than my rather large spring boot project.

Could you fill me in on what the error means so that I can better go about reproducing it- or fixing it?

@jasongonzales23
Copy link

+1

@davidbarton
Copy link

May be related to #682

@jasongonzales23
Copy link

Ultimately my issue did boil down to #682 however, the patch doesn't help if the component you are testing imports other components. Super frustrating.

@mikecousins
Copy link

Yeah, this one is super annoying.

@cpojer
Copy link
Member

cpojer commented Mar 3, 2016

The error message will link to http://facebook.github.io/jest/docs/manual-mocks.html#content in 0.9.0. Some modules use meta programming and can't properly be mocked. The guide should have examples on how to work around it.

Jest 0.9.0 also has better mocking capabilities, so this issue might go away for your modules.

@BruceL33t
Copy link

@cpojer can you explain more about what "some modules use meta programming" and the reason why they "can't properly be mocket" because right now I face a weird issue, where I get this error when trying to call genMockFromModule on a package built with Babel 7, preset-typescript - but it works if I build the package with Babel 6 and ts-loader. Do you have any idea, what the difference might be?

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants