Fix types resolution when importing jest types from @jest/globals #602
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.
Summary
This pull request contains :
expect-puppeteer
matchers types resolution when jest types are imported from@jest/globals
(issue 601).@types/jest
is no longer mandatory and the project is now 100% compliant to jest official recommendations.jest-environment-puppeteer
README to describe how to set up with typescript in a more detailed way.expect-puppeteer
README to adhere to the current API and point to the new puppeteer docs.expect-puppeteer
imports in the test files that do not useexpect
.toClick.ts
).Note : due to the way typescript resolves modules, the community-provided types for
jest-puppeteer
will be prevalent if still installed despite being outdated. As a result, I've added a note in the README to recommend uninstalling them when upgrading to>=10.1.2
.Test plan
No breaking changes or regressions should occur since the implementation was left untouched, only types declarations were changed. Note though that a (breaking?) change was introduced in 10.1.2 since the types resolution for the
jest-environment-puppeteer
globals requires importingjest-puppeteer
explicitly when not using the deprecated pre v8.0.0 types. As a result, I don't know if it commends a new minor let major version since it only affects the DX, but I think it's worthy of mentioning.Test suite passes 100%.
@types/jest
is not installed) :@types/jest
.