-
-
Notifications
You must be signed in to change notification settings - Fork 174
test(types): introduce tstyche instead of tsd #633
test(types): introduce tstyche instead of tsd #633
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for giving TSTyche a try. Glad to see this. I have left few inline comments.
One more important detail. By default, TSTyche logs the installed typescript
package. The version used for testing is printed in the log:

This is different from tsd
which ships with its own copy of @tsd/typescript
. The exact version can be found here:
postgrest-js/package-lock.json
Lines 1123 to 1124 in 823f28f
"node_modules/@tsd/typescript": { | |
"version": "5.4.5", |
All depends on your strategy. You can run npx tstyche --target 5.4
to test against TypeScript 5.4.5. (Few checks error messages are failing because of minor changes between TypeScript versions.)
Or you can run npx tstyche --target '>=5.4'
to test against TypeScript 5.4, 5.6, 5.7, etc. (Takes time. Might be too much for local checks. But definitely good idea for CI.)
That's great ! Definitely something we want in CI/CD ! We had issues before with having breaking changes between versions of typescript on the user project, so if we can cover that easily, that's perfect ! I would say maybe cover all above or equal to the version of typescript we do use in So |
Only
That’s why I was thinking that keeping support only for |
- Remove ts-expect since we only use TypeEqual - Add multiples typescript versions types testing for ci
Still worth mentioning that re-writing the types, we did had some frictions using some non But as time pass, I guess we can expect people to migrate more and more and this retro-compatiblity to be less and less useful. |
Running all the checks over all the versions slow down the CI a bit too much. Only ensure consitency between most used major + latest version
Co-authored-by: Tom Mrazauskas <[email protected]>
Asking review from @soedirgo for approval |
🎉 This PR is included in version 1.21.4 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What kind of change does this PR introduce?
Following up: #632 (comment)
tstyche
to improve the type testing by adding expected message matching to the@ts-expect-errors
tstyche
to check that types tests passes across a wide ranges of Typescript versions (>=4.7
)tsd
since we no longer needs it. Removets-expect
and extractTypeEqual
which is the only used utils from it.