Testy / TestyTs

✔️ Modern TypeScript testing framework.
http://testy.github.io
ISC License
123 stars 8 forks source link

Upgrade TypeScript to version 4 #90

Closed bashlund closed 2 years ago

bashlund commented 2 years ago

Thank you for TestyTs!

There are some nice features in TypeScript 4 (4.2.4 as I use) when declaring a name together with the return type, which I would really like TestyTs to be compatible with.

Example:

// Does NOT work
unpackField(image: Buffer, pointer: number): [field: Field, value: any, newPointer: number] {}
// Does work
unpackField(image: Buffer, pointer: number): [Field, any, number] {}

This code requires a newer version of TypeScript than TestyTs uses.

I can hack this to work with TestyTS if I manually update the version of ./node_modules/testyts/package.json to TypeScript 4.2.4 and run npm i from within that directory.

Thank you!

Aboisier commented 2 years ago

Thanks for reporting this. I'll tackle this next! :)

bashlund commented 2 years ago

Awesome :) :sparkles:

Aboisier commented 2 years ago

Hi @bashlund ! Do you have a repo with a repro you could share? I tried reproducing your issue and, somehow, I am able to run the tests without having to update TestyTs's TS version. I noticed I have a recent version of typescript installed globally, perhaps this is why this works on my machine?

Thanks! :)

Edit: I just released a new version (2.0.0-beta.5) in which I updated most of TestyTs's dependencies. I still have more testing to do, but let me know if this fixes your issue. Thanks!

bashlund commented 2 years ago

Hey @Aboisier ! I created fresh repo here: https://github.com/bashlund/testyts-typescript-version-test

However, I could not repro it either! Until I had added different packages back and forth, then the issue appeared.

Then I did rm -rf node_modules; npm i and the issue was still there, however when also did rm package-lock.json; npm i then the issue disappeared again.

Conclusion seems to be that the "issue" was not TestyTs TS version but instead embedded in my cluttered package-lock.json somehow (?).

I tried both Testy version 1.3 and 1.5 for this.

Sorry for the inconvenience and thank you for updating the dependencies anyways :))

Aboisier commented 2 years ago

Huh that's odd! I'll close this for now, but let me know if this happens again!

Thanks!