-
Notifications
You must be signed in to change notification settings - Fork 1
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
alternative idea: zero dependency ts
parser / typechecker
#32
Comments
If that works that'd make me very happy 🙂 Happy to host it here in the org if it works out! |
Yes, would great to host it in |
@mrazauskas this is incredible work - so excited to see it in action. Is the source for what your working on available anywhere by chance? I'd love to see internally how you're doing things |
@crutchcorn Thanks. Currently code lives in private repo, but it will become public at some point. All updates will be posted here (; |
At some point I added a comment next to In the other hand, The matcher works, but needs to be tested with more complex examples. So I will have time to think. |
Hey, thank you all for working on this! I just published something similar, but I used the Jest transform approach so Jest can run typing tests alongside regular tests with tsd under the hood: https://github.com/TexKiller/jest-tsd-transform I'm also looking forward to checking out @mrazauskas's approach |
Just to leave a note. I was working on the library recently. Here is what it currently does: As you see, it has built-in mechanism to run tests upon different versions of TypeScript. For me that was a must feature to have. Very happy to look at it ;D That was tricky to implement. I had to deal with CLI and config. The initial idea was to delegate those tasks to Jest, but user needs a way to define TS version somehow. The code still needs work. Some parts are sketchy and must be cleaned up. Moving forward. |
This is super exciting stuff 😀 |
One year later and... a lot have happened! The library is nearly finished. Already some time ago it felt finished, but I wanted to integrate it with VS Code via an extension. That was a disappointment, because the public APIs I had were not doing right job. In parallel I was trying to run type tests in a larger repo and must admit that performance was just horrible. There was no other way just to rewrite everything. The code is in better shape now. Before it took 3.2 secs to run all the type tests in libraries own repo, now that is just 0.7 sec. Almost hard to believe how slow it was ;D |
And here it is! TSTyche – The Essential Type Testing Tool. Repo: https://github.com/tstyche/tstyche Few notable features of TSTyche:
Currently it is published as beta. I would like to collect some feedback before releasing a stable release (planning to do so early next year). Please, give it try. If something looks clumsy, drop me a line here or open an issue in the repo. In general the plan is to replace The architecture of As a reference, here are the first migration PRs: Jest RedwoodJS Typegoose
|
Looks good! In the meantime I've migrated to Vitest, which provides |
Vitest's implementation is somewhat similar to Admittedly Vitest makes it possible to select files and provides some In TSTyche skip means skip: import { expect, test } from "tstyche";
test.skip("is skipped?", () => {
const a: string = 123; // obviously a type error, but it will be skipped
// ...
}); |
Also worth to add that In the beginning TSTyche was a plugable runner too. I wanted to make it to work with Jest, and Vitest, and any other framework which can have runners. This was interesting experiment, but I was struggling with that Why? all the time. Why to spend time creating haste map? Why to have Vite next to At some point I realised that all what a type testing tool needs is to wrap around |
TSTyche reached almost 1000 downloads on npm. Given that type testing is a very niche thing (hard to find a blogpost about it), that is way more than I expected. Thanks to everyone for giving it a try! Time to close this issue. |
From #25
@SimenB Just to leave a note. I was thinking / working on a
ts
parser, which reads a file like this one:And returns:
Not yet finished, but it works! Reporter and runner are the missing parts.
While working on this, I was thinking if having
test
s is really useful? It is, of course! Few reasons:.skip
,.only
,.todo
The solution I have at this moment:
jest
, its dependencies andtypescript
);zero config ((edit: it will have config to allow testing upon different versions of TypeScript's compiler)jest.config
andtsconfig.json
do the job);Working on it. Will be posting updates here. This is not
tsd
based solution anymore, but I think it is related tojest-runner-tsd
.The text was updated successfully, but these errors were encountered: