-
-
Notifications
You must be signed in to change notification settings - Fork 170
test(types): introduce tstyche instead of tsd #633
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
base: master
Are you sure you want to change the base?
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 |
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.