-
Notifications
You must be signed in to change notification settings - Fork 31
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
chore: migrate type tests to TSTyche #135
chore: migrate type tests to TSTyche #135
Conversation
glass-easel/jest.config.js
Outdated
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.
Content of jest.unit.config.js
got copied here.
|
||
expect(data.propNull).type.toBeAny() | ||
|
||
expect(data).type.not.toHaveProperty('nonExists') |
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.
.toHaveProperty()
can be used. No more // @ts-expect-error
.
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.
Notice how many dependencies are removed. The install size of TSTyche is under 200 kB.
By the way, TSTyche also has helpers like |
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"types": [] |
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.
This is here to avoid global typings leaked from @types/jest
and @types/node
. The type tests are not executed, hence it could be very hard to catch mistakes coming from global typings. In this context, it is better to have less accidental typings around.
@LastLeaf Friendly ping. All is fine, if this does not look interesting or so. I just wanted to help. |
This PR migrates type tests to TSTyche. It is a new type testing tool which is replacing
tsd-lite
andjest-runner-tsd
.Just to draw your attention,
tsd-lite
is deprecated. I was maintaining it and I was helping with the runner as well. Unfortunately the inner architecture oftsd
is very limiting. To improve it I had to write a type test runner from scratch. Please meet TSTyche:expect
style assertions (and has matchers like.toHaveProperty()
),tstyche --target 4.8,latest
.Currently TSTyche is used by Immutable.js, Jest, Redwood and few more smaller projects (including my own packages).
Repo: https://github.com/tstyche/tstyche
Documentation: https://tstyche.org