Skip to content
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

Remove snapshots #16

Merged
merged 1 commit into from
Jun 7, 2018
Merged

Remove snapshots #16

merged 1 commit into from
Jun 7, 2018

Conversation

gnapse
Copy link
Member

@gnapse gnapse commented Jun 7, 2018

What:

Removing snapshots of error messages in the tests that are expected to throw.

Why:

Because the terminal output stored I these snapshots is not the same in terminals where colors are not supported, such as in Travis-CI.

Checklist:

  • Tests
  • Ready to be merged

@gnapse gnapse added the bug Something isn't working label Jun 7, 2018
@gnapse gnapse self-assigned this Jun 7, 2018
@gnapse gnapse mentioned this pull request Jun 7, 2018
3 tasks
@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@48b11fb). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             master    #16   +/-   ##
=======================================
  Coverage          ?   100%           
=======================================
  Files             ?      8           
  Lines             ?     74           
  Branches          ?     15           
=======================================
  Hits              ?     74           
  Misses            ?      0           
  Partials          ?      0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 48b11fb...95febd1. Read the comment docs.

@kentcdodds
Copy link
Member

You could also strip the ansi characters with a snapshot serializer. I'm pretty sure there's a module that does this.

@microcood
Copy link
Contributor

Also disable chalk before tests beforeAll(() => { chalk.enabled = false; }); will work.
More interesting question why CI does not work. How its different between PR and master

@gnapse
Copy link
Member Author

gnapse commented Jun 7, 2018

There's a just issue I referenced in the PR that introduced this problem (jestjs/jest#4407) where they talk a bit more about this, and that it is expected. They suggest the serializer there, but I haven't found any yet. Suggestions of where to look are welcome. I already looked in jest-awesome with no luck.

I also should've detected this in the original PR, because the codecov report never appeared and I did not notice.

BTW, interesting the chalk.enabled fix. I guess that's the real fallback I should use if the serializer does not appear. At least it allows us to keep snapshots in place. Thanks!

@kentcdodds
Copy link
Member

Try this one: https://github.com/joaogranado/jest-serializer-ansi

@gnapse
Copy link
Member Author

gnapse commented Jun 7, 2018

Done in #17, but somehow build is still failing over there, even when they all pass locally :(

@kentcdodds
Copy link
Member

Ugh.

@microcood
Copy link
Contributor

Most likely that's the issue travis-ci/travis-ci#7967

@gnapse
Copy link
Member Author

gnapse commented Jun 7, 2018

There doesn't seem to be a definite solution for this problem in that travis issue discussion :(

Given that #17 remains failing for some other reason even after serializing snapshots without the ansi stuff, I'm leaning towards merging this PR, because it nevertheless fixes the issue reported in testing-library/dom-testing-library#50.

I'll try to dig a bit more and wait until later today, to see if a this can be solved. Otherwise I'll merge this PR because we can always bring back the snapshots with proper serialization and/or travis settings fixed or whatever, in a later PR.

@gnapse gnapse merged commit 200ee31 into master Jun 7, 2018
@gnapse gnapse deleted the pr/remove-snapshots branch June 7, 2018 20:04
@gnapse
Copy link
Member Author

gnapse commented Jun 7, 2018

🎉 This PR is included in version 1.3.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants