Generated UUID in 4.0.5 breaks snapshot testing
See original GitHub issueThis commit https://github.com/wwayne/react-tooltip/commit/78e3c2be784f2b96d8bb888b81785b2b38179dae added generateUUID
, which generates a random UUID every time a tooltip is rendered, which changes Jest snapshots every time they’re run.
That commit was done in https://github.com/wwayne/react-tooltip/pull/559, which says “No changes in workflows or documentation”, which, while true, apparently didn’t take into account changes in the DOM and testing. I would recommend a solution without the uuid
state, if possible, but if not, some override that would disable the UUID in testing
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Generated UUID in 4.0.5 breaks snapshot testing #562 - GitHub
This commit 78e3c2b added generateUUID , which generates a random UUID every time a tooltip is rendered, which changes Jest snapshots every ...
Read more >How to mock uuid with Jest - Stack Overflow
Mock it by using mockImplementation . import uuid from 'uuid/v4'; jest.mock('uuid/v4'); describe('mock uuid', () => { it('should return ...
Read more >Snapshot Testing - Jest
Snapshot tests are a very useful tool whenever you want to make sure your UI does not change unexpectedly.
Read more >jest uuid syntaxerror: unexpected token 'export' - You.com
I can't get my tests to run. When I run 'yarn test' for my react app, I get the dreaded error: Jest encountered...
Read more >The Grails Framework 4.0.5
2.9Testing an Application. 2.10Deploying an Application. 2.11Supported Java EE Containers. 2.12Creating Artefacts. 2.13Generating an Application.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
So it’s not nice but it works:
With this my classNames look like:
🎉 This issue has been resolved in version 4.1.5 🎉
The release is available on:
Your semantic-release bot 📦🚀