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 #1825

Merged
merged 8 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:
  • Added relevant unit test for your changes. (yarn test)
  • Verified code coverage for the changes made. Check coverage report at: <rootDir>/test-results/unit/coverage
  • Ran precheckin (yarn precheckin)

@DaveTryon DaveTryon requested a review from a team as a code owner September 22, 2023 15:54
@DaveTryon DaveTryon merged commit f88f3b4 into microsoft:main Sep 22, 2023
3 checks passed
@DaveTryon DaveTryon deleted the remove-inline-snapshots branch September 26, 2023 22:41
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