-
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
feat!: replace mlh-tsd
with tsd-lite
#41
Conversation
all of these features seems like things upstream That said, happy to land them here now! Would you consider this a breaking change? I guess so due to the peer dep requirement (which is a good idea 👍 ) |
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 great, thanks!
Could you update the readme as well? At least mention the peer dependency
Indeed, can’t agree more. The changes breaking. For instance, I will add a note on strictness to |
Just fixed documentation. That’s obviously breaking change. Also |
Some more improvement. The vanilla
Could not finish updating documentation without this improvement. Will move on with docs now. |
@mrazauskas sorry, lost track of this. Do you think it's ready? 😀 |
In general it is ready. I have one more small change in At the same time, I was in doubt. The readme still sounds like this is a workaround. So I was fine to leave it to cool down a bit. And to ask again: does it look good? Hm.. Perhaps this is alright as a temporary solution? Still working on what is mentioned in #32. Had to rewrite my parser completely, now I was trying to migrate some parts of Jest’s type tests to my new testing tool. Looked very promising. There are cases which do not work yet. Polishing it. Should be finished in few months. So this PR is somewhat temporary solution. At least that’s how I see it. Could be merged, but it can wait too. Might be good idea to unblock the issues which I was mentioning in the first comment. How do you feel about it? (; |
I'm hoping to have a burst of energy soonish to land a new major of Jest, at which point I wanna land an update of TS. So I think landing this now, while waiting for #32 makes sense - it's still an improvement over what we have today 🙂 |
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.
LGTM, just some nits for the readme 🙂
@SimenB All should be fixed. Take a look, please. Glad to hear you are think about a new major of Jest. Node 10 support also becomes more and more blocking. Time to move on? |
Yep, dropping node 10 and 15 🙂 |
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!
Can do a quick v3 dropping node 10? |
Sure. Yes, I can do. Also Renovate will be happier. |
Would you mind sending a PR to jest updating to v2? then we'll do v3 when I land jestjs/jest#12220 |
Ok. Will do this. |
Should unblock jestjs/jest#11142 and jestjs/jest#12198. Also this change would allow to uncomment few assertions of jestjs/jest#11949. This is a lot! That is why I though it is time for
tsd-lite
.The type testing logic is the same between
tsd
,mlh-tsd
andtsd-lite
.The aim of
tsd-lite
was to remove logic unrelated with type testing. For instance,tsd
andmlh-tsd
are making few more checks like: if.d.ts
file exist, if it is included inpackage.json
files
property, etc. These checks and rules are removed intsd-lite
.Additionally
tsd-lite
is returningfileText
for each failed assertion. TS compiler includes file contents with each diagnostic, so runner does not have to read files again.Another feature I like –
tsd-lite
is using nearesttsconfig.json
to read compiler options for each test file. This is close to howtsc
works. User can have configuration for the whole project, or a group of test file, or just one test file. With"extends"
option that’s incredibly flexible. For comparison, vanillatsd
is only usingtsconfig.json
from the root of the project, it also allows to add TS compiler options topackage.json
and has some defaults which cannot be overridden. Hm.. Might be good for a library written in JS, but sounds complicated and unnecessary for a TS project.All differences are documented in
tsd-lite
repo – https://github.com/mrazauskas/tsd-liteTest plan
I added test to cover both JS and TS projects.
Todo
Last but not least, I have to send another PR to update Readme file.