Comments (4)
Do you provide a flow libdef? My flow libdef for jest-environment-enzyme
is an autogenerated stub.
from enzyme-matchers.
You've got to install Jest's type definitions from flow-typed
.
npm i -g flow-typed
if you haven't previously.
flow-typed install [email protected]
or any version you use.
The Jest definitions contains jest-enzyme ones.
Also from the error you pasted, I guess you need the enzyme ones as well.
flow-typed install [email protected]
or any version you use.
from enzyme-matchers.
Thanks for your response. I already have the type definitions for [email protected]
:
flow-typed/npm/jest_v23.x.x.js
// flow-typed signature: 78c200acffbcc16bba9478f5396c3a00
// flow-typed version: b2980740dd/jest_v23.x.x/flow_>=v0.39.x
I presume flow is not complaining about missing type definitions, but about the missing import.
How do you tell flow that shallow
and mount
are available as globals?
from enzyme-matchers.
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 enzyme-matchers.
Related Issues (20)
- jest-enzyme + typescript: non-string selectors are rejected HOT 2
- jest-enzyme not working with create-react-app HOT 3
- jest-environment-enzyme has vulnerability in dependencies HOT 1
- README must explain why not jest-environment-jsdom HOT 2
- 7.0.1 -> 7.0.2 Incompatible with node 9 HOT 1
- Incorrect flow typing for getDisplayName HOT 1
- Matchers incompatible with @types/jest 24.0.20 HOT 4
- Rename toContainReact HOT 3
- v7.1.2 is not working on IE HOT 2
- toBeDisabled not working as expected HOT 4
- Update jest-environment-jsdom in jest-environment-enzyme
- argv.config.match is not a function, Process finished with exit code 1
- Transfer to the enzymejs org? HOT 11
- Release new version of `jest-environment-enzyme` HOT 8
- jest-enzyme: docs: installing jest-enzyme and its type defs HOT 1
- The current version of jest-enzyme breaks the latest version of jest HOT 6
- Status of the project HOT 13
- jest-enzyme: vulnerability related to unset-value HOT 1
- `toContainMatchingElement` considers `className` prop rather than actual HTML HOT 6
- jest-enzyme toHaveClassName does not work with some tailwind classes
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from enzyme-matchers.