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

chore: Remove inline snapshots #6976

Merged
merged 32 commits into from
Sep 22, 2023

Conversation

DaveTryon
Copy link
Contributor

Details

Due to jestjs/jest#14305, our inline snapshots are causing problems when using yarn test -u. We discussed this internally and decided that the simplest approach was to convert the inline snapshots to traditional snapshots. For most cases, this was just removing "Inline" from the method name and removing the string that provided the snapshot. A small number of test cases were checking multiple inline snapshots in the same test, so the approach there was to build an array of the things that were previously checked individually, then having a single snapshot for the test case.

I ran yarn test -u and yarn format:fix after making all of the changes, just to make sure that we're ready for future changes.

It will probably be easiest to review this one commit at a time--each of the 32 commits represents the conversion of a single test case.

Motivation
Context

Pull request checklist

  • [n/a] Addresses an existing issue
  • Ran yarn fastpass
  • Added/updated relevant unit test(s) (and ran yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • PR title AND final merge commit title both start with a semantic tag (fix:, chore:, feat(feature-name):, refactor:). See CONTRIBUTING.md.
  • [n/a] (UI changes only) Added screenshots/GIFs to description above
  • [n/a] (UI changes only) Verified usability with NVDA/JAWS

@DaveTryon DaveTryon requested a review from a team as a code owner September 22, 2023 00:32
Copy link
Contributor

@madalynrose madalynrose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for splitting this into easily digestible commits!

@DaveTryon DaveTryon merged commit 9ef8cdf into microsoft:main Sep 22, 2023
@DaveTryon DaveTryon deleted the remove-inline-snapshots branch September 23, 2023 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants