-
Notifications
You must be signed in to change notification settings - Fork 993
Introduced tsd for type checking and to guard against unintentional API changes #3015
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
Conversation
…al API changes. For example, a test like this would have caught Turfjs#3006
|
Would be good to get this (or something like it) in place so we can use it to support changes like #3012. |
|
This looks pretty slick 🎉 How useful are the errors when you get a failing test? I used something similar before with I'd be willing to adopt this today even with unhelpful errors coming out of |
|
Please also consider TSTyche for testing types: https://tstyche.org. I am its author. Take a better look at the To mention a few benefits of TSTyche:
|
|
@mfedderly the error messages from tsd were comparable to what you'd see from tsc. Plenty good enough to act as a type checking canary. Though what do you think about TSTyche? I'll put together a comparison PR. Thanks for bringing TSTyche to our attention @mrazauskas! |
|
Example error output for comparison with TSTyche output in #3020: |
|
Note that the Comparing objects with some nested Worth mentioning that Another aspect, as you see Sorry, if this comment sounds too negative. As I mentioned, I really like You know the requirements of your project. So use what suits you best. |
mfedderly
left a comment
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.
Approving this one as well for the optionality, but probably we should go with tstyche
|
Closing this PR in favour of using tstyche #3020 |
Introduces tsd into an initial package to replace the
tsc types.tstests. tsd checks independently from tsc and provides some additional functionality around type checking e.g. expectError.A test like the one included in this PR would have caught #3006.
This is an initial trial for the dev environment. If successful we can migrate existing types.ts files over package by package.
Please provide the following when creating a PR:
contributorsfield ofpackage.json- you've earned it! 👏