-
-
Notifications
You must be signed in to change notification settings - Fork 530
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
Generated UUID in 4.0.5 breaks snapshot testing #562
Comments
It's better to use v4 from npm module uuid to implement generateUUID. Module "uuid" may be mocked in jest for testing. But it's impossible to mock function that is not exported from your module. |
@Rogger794 Are there any plans to fix this in an upcoming release? |
Sounds like we have a proposed fix. We would be happy to accept a PR to fix
it.
…On Fri, Mar 20, 2020 at 9:27 AM Steven Rathbauer ***@***.***> wrote:
@Rogger794 <https://github.com/Rogger794> Are there any plans to fix this
in an upcoming release?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#562 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEX6THN4AY3OHQ7I7BNPG73RINVNBANCNFSM4LF7AXMQ>
.
|
🎉 This issue has been resolved in version 4.1.5 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi, I'm afraid the issue still stands. The |
it would be nice if you could just optionally send a flag through the component to override the class. I think this would resolve the problem for snapshots |
So it's not nice but it works:
With this my classNames look like:
|
Could this be an issue with rollup's config? I don't have experience with this tool, but it seems that we should exclude // rollup.config.js
...
export default {
external: Object.keys(pkg.dependencies || {}),
... or put |
my vote is for excluding dependencies or you could simply just exclude uuid, but since there are only two deps in package it is probably ok to do them all. the single approach would be this: external: ['uuid'] |
This commit 78e3c2b 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 #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 testingThe text was updated successfully, but these errors were encountered: