chore: remove expect from dev dependencies of pretty-format.
#13286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
From #13283 (comment)
Summary
Here is a quick idea how
expectcould be removed from the dev dependencies ofpretty-format.expectis needed only for one test, which is testingDummyMatcherclass which is defined in the test file. This class is extendingAsymmetricMatcherabstract class which is imported fromexpect.The imported
AsymmetricMatcherabstract class looks like this:https://github.com/facebook/jest/blob/561907ce5d1e9065311cf585f75b9c5864036193/packages/expect/src/asymmetricMatchers.ts#L67-L89
All what the test needs is
toAsymmetricMatchermethod, but as one can see above it is not implemented in the parent class. This means that only the constructor and$$typeofproperty ofAsymmetricMatcherare useful. I think we can safely copy these toDummyMatcherclass and removeexpectas a dependency. Or?Test plan
Green CI.