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

Add toMatchNamedSnapshot matcher #11605

Conversation

samuelfullerthomas
Copy link

Summary

Adds a toMatchNamedSnapshot matcher for use:

  • in concurrent test mode
  • for people who want to name their snapshots for whatever reason.

I figured that having a separate matcher made the most sense so that I didn't have to change the API for the original matcher, which would be most compatible for existing toMatchSnapshot api usage.

Addresses #2180 and #5801. I've got some test written but I was hoping that y'all might have some thoughts about:

  • is this the right way forward? Or is there something else you were hoping for?
  • should I just add the same unit tests as the toMatchSnapshot?

Test plan

  • Updating unit tests in the jest-snapshot package
  • Updating integration tests

@samuelfullerthomas
Copy link
Author

thoughts @SimenB ?

@SimenB
Copy link
Member

SimenB commented Feb 24, 2022

Oh, this is interesting, sorry I missed it! Could you rebase?

We also need an integration test, plus tests asserting that some error is thrown if two tests are named the same in the same test suite

@samuelfullerthomas
Copy link
Author

Hi @SimenB - can rebase - will try to get this ready this week

@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants