-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Pretty format mounted html #649
Comments
I think it would be great if this were part of enzyme. Currently enzyme-to-json provides this functionality, but it breaks when coverage testing. So currently there's no good solution when you want to use enzyme and do coverage testing. So +1 for adding this to enzyme. |
In general snapshot testing makes your tests more brittle - I'm not sure it's a good idea to make it more pleasant/easier to use it. |
Is there any objective evidence for that? |
I have lots of anecdotal experience with it - what happens is that it's not explicit and thus clear what is being tested - ie, what's important - and then, when someone changes something that breaks the snapshot by design, it's very very easy to just check in the new snapshot, and not notice that an unrelated thing you changed broke. Explicit tests take longer to write, but they're much harder for humans to unintentionally ignore failures with. |
Hmm ok. Yeah I can see how that would be problematic. I like using them for more presentational components. Especially the ones that change a lot in structure but still fulfill the same function, where function isn't easily expressed in a test. It's easier for me to check the snapshot than write a test that pretty much describes the markup. |
@MayasHaddad @ismay fwiw, I'm bringing this functionality into |
Cool! 👍 |
I am using
jest
and this code works goodexcept that I want the generated snapshot to be multiline, indented html.
Quite like this without having to use tools like enzyme-to-json
Any clue?
The text was updated successfully, but these errors were encountered: