-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Flow cannot resolve globalized enzyme variables #289
Comments
Do you provide a flow libdef? My flow libdef for |
You've got to install Jest's type definitions from
The Jest definitions contains jest-enzyme ones. Also from the error you pasted, I guess you need the enzyme ones as well. |
Thanks for your response. I already have the type definitions for flow-typed/npm/jest_v23.x.x.js
I presume flow is not complaining about missing type definitions, but about the missing import. How do you tell flow that |
I would create a mock file, but since a definition can't reference or import another one, I'm afraid your up for some copy/pasting of the flow-typed enzyme declaration and make it global. Or paste that into the enzyme declaration, but it might get overridden on updates. declare var mount: $PropertyType<$Exports<'enzyme'>, 'mount'>;
declare var shallow: $PropertyType<$Exports<'enzyme'>, 'shallow'>; |
From jest-environment-enzyme:
This requires eslint-config-jest-enzyme to pass the linter. But how do you make your tests pass flow if they don't import
mount
andshallow
? I'm getting this:The text was updated successfully, but these errors were encountered: