-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
discussion starter: specify ts version #62
Conversation
@@ -0,0 +1,3 @@ | |||
import * as ts from "@testable-ts/v3.0"; |
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 has to be a 3.0 version of typescript because newer typescript versions make use of non-downward-compatible typescript features in their types.
So testing 3.0 with types of 3.7 does not work, while testing 3.7 with types from 3.0 works just fine - especially as these types are just being used to interpret the code of tsd
itself (I am not sure but I believe outside of the test suite this would not play any role at all).
@@ -0,0 +1,2 @@ | |||
module.exports = require(process.env.TYPESCRIPT_PATH || | |||
__dirname + "/../shipped-typescript"); |
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 where the magic happens: use the environment variable or fall back the shipped typescript version (current behaviour)
@SamVerschueren it's been a while, do you have any feedback on this? |
Hi @phryneas! Sorry for my late replies but started to allocate more time for tsd. I believe this is somewhat where I want to go to yes. I believe it would be nice if you could specify the TS versions you want to test in the tsd config.
Not sure yet about the syntax. But running That would be super cool! What do you think? |
That would be pretty incredible although it might probably be necessary to skip some tests depending on TS version (no use running tests with |
Closing this as it's WIP currently. Feel free to discuss in the issue #47. |
This is more a discussion starter than an actual PR right now - but it works.
I've been able to run the tests for all versions from 3.0 to 3.7 with this approach by installing the respective
@testable-ts
version and executing them likeTYPESCRIPT_PATH=@testable-ts/v3.7 yarn test
Do you think this approach has any merit?