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

fix(expect): support expect.addSnapshotSerializer #6173

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

eryue0220
Copy link
Contributor

Part of #3964, support expect.addSnapshotSerializer api.

@eryue0220
Copy link
Contributor Author

The error about typo checking has submitted in this pr #6171.

Copy link

codecov bot commented Nov 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.51%. Comparing base (4ec1800) to head (c0a1d27).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6173      +/-   ##
==========================================
+ Coverage   96.49%   96.51%   +0.02%     
==========================================
  Files         538      539       +1     
  Lines       40969    41289     +320     
  Branches     6162     6160       -2     
==========================================
+ Hits        39531    39851     +320     
  Misses       1394     1394              
  Partials       44       44              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eryue0220 eryue0220 marked this pull request as draft November 4, 2024 08:24
@eryue0220 eryue0220 marked this pull request as ready for review November 4, 2024 10:16
expect/expect.ts Outdated
* `expect.addSnapshotSerializer` adds a module that formats application-specific data structures.
*
* For an individual test file, an added module precedes any modules from snapshotSerializers configuration,
* which precede the default snapshot serializers for built-in JavaScript types and for React elements.
Copy link
Member

Choose a reason for hiding this comment

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

I'm removing for React elements part as that phrase feels strange in this repo.

@@ -915,3 +915,5 @@ export interface OldSnapshotPlugin {
) => string;
test: Test;
}

export type SnapshotPlugin = NewSnapshotPlugin | OldSnapshotPlugin;
Copy link
Member

Choose a reason for hiding this comment

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

Is OldSnapshotPlugin still common? How about only supporting NewSnapshotPlugin?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants