-
Notifications
You must be signed in to change notification settings - Fork 676
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
Combine test compile step into normal compile #5666
Conversation
a0d05d3
to
dd03af8
Compare
dd03af8
to
ed2899a
Compare
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 so much for taking on the job of fixing up the tests. Had a few suggestions but I would be fine if things merged as is.
@@ -31,66 +31,66 @@ suite("GetOmnisharpPackage : Output package depends on the input package and oth | |||
|
|||
test(`Architectures, binaries and platforms do not change useFramework: ${useFramework}`, () => { | |||
let testPackage = inputPackages.find(element => (element.platformId && element.platformId == "os-architecture")); | |||
let resultPackage = SetBinaryAndGetPackage(testPackage, useFramework, serverUrl, version, installPath); | |||
let resultPackage = SetBinaryAndGetPackage(testPackage!, useFramework, serverUrl, version, installPath); |
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.
Could add a helper such as the one in this TS playground, then the compiler would be happy.
function isNotNull<T>(value: T) : asserts value is NonNullable<T> {
if (value === null || value === undefined) {
throw new Error("value is null or undefined.");
}
}
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.
I added this, and updated all the places that I thought made sense to use it
- Places that were asserting not null using the non-annotated APIs were replaced with this function
- Places where the nullable item was used multiple times (and would have required multiple
!
) I also replaced
Otherwise, I left the !
usage when the nullable item was used only once
7abd1d7
to
36f342b
Compare
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.
Latest changes look good!
This makes it so compile also compiles tests. There were lots of nullable warnings which I either fixed or suppressed when makes sense.
Unfortunately it looks like chai/mocha methods don't tell the TS compiler when things have been asserted to be non-null, so there are lots of
!
.