Comments (2)
Also, thank you for this library :). I've really missed shallow rendering since we've started using hooks more regularly, and I really hope I can get it working
from jest-react-hooks-shallow.
I am also having this problem:
"react": "^17.0.2",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
"babel-jest": "^27.5.1",
"enzyme": "^3.11.0",
"jest": "^27.5.1",
"jest-react-hooks-shallow": "^1.5.1",
"regenerator-runtime": "^0.13.9"
dontMockByDefault
seems to not be mocking the hooks for shallow renders as expected, but it's still causing problems with mount. I have found that if I wrap the tests with withoutHooks
it works as expected, but my understanding is that this shouldn't be necessary if dontMockByDefault
is set to true
.
from jest-react-hooks-shallow.
Related Issues (20)
- script random number in range
- beforeEach is not defined HOT 10
- enableHooks not sufficient if jest config contains "resetMocks: true" HOT 11
- beforeEach is not defined HOT 1
- withHooks and withoutHooks do not support async tests / promises HOT 12
- Clash with mocking React to work around useRef problems HOT 2
- Acknowledgement HOT 1
- How to run useEffect cleanup - Help HOT 1
- useEffect run cleanup function in wrong trigger HOT 1
- Consider back documenting to enzyme's open issue HOT 1
- Added plugin to package.json HOT 1
- Doesn't seem to play well with ts-jest HOT 1
- Incompatible with Jest 26+ HOT 7
- Possible way to get around mount issues
- Npm7 & React 17 peer dependency error HOT 1
- Not working correctly with beforeAll
- work with jest 27? HOT 2
- Support for storybook HOT 1
- Support for React 18 ?
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 jest-react-hooks-shallow.