-
Notifications
You must be signed in to change notification settings - Fork 40
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
test: enable suppressTypeErrors on all integration tests #1549
test: enable suppressTypeErrors on all integration tests #1549
Conversation
3a66f23
to
56e4f5d
Compare
56e4f5d
to
1745a1d
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1549 +/- ##
==========================================
+ Coverage 75.35% 75.50% +0.15%
==========================================
Files 177 177
Lines 7566 7585 +19
Branches 1069 1077 +8
==========================================
+ Hits 5701 5727 +26
+ Misses 1860 1853 -7
Partials 5 5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@JoshuaKGoldberg I hope that this one is more straightforward to review :) |
…errors-on-integration-tests
@JoshuaKGoldberg friendly ping! Could you check if this makes sense to you? I think it will help in the future changes to see if the code in tests is correct or not :) |
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.
OK! Thanks for the ping, and sorry this took so long. Kind of a behemoth to review 😅 but a very good step for comprehensive tests. Thank you for pushing it forward!
@@ -113,6 +116,7 @@ | |||
}; | |||
|
|||
const returnsBigintOrNumber = (): number | bigint => { | |||
// @ts-expect-error -- TODO: BigInt literals are not available when targeting lower than ES2020. |
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.
[Testing] Let's switch the test to use ESNext. Testing for this error isn't the point of the test.
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.
It's currently set to "ES2020", and it doesn't change the error if I set it to "ESNext".
return <div />; | ||
} | ||
} | ||
|
||
const renderSinglePropClassDeclaration = () => ( | ||
// @ts-expect-error -- TODO: Cannot use JSX unless the '--jsx' flag is provided. |
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.
[Testing] Tests with .tsx
files should enable the jsx flag.
import React from "react"; | ||
// @ts-expect-error -- TODO: This module can only be default-imported using the 'esModuleInterop' flag |
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.
[Testing] This and other tests should have esModuleInterop
enabled.
test/cases/fixes/incompleteTypes/reactTypes/reactPropsFromPropTypes/all/original.tsx
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,6 @@ | |||
// @ts-expect-error -- TODO: This module can only be default-imported using the 'esModuleInterop' flag | |||
import ts from "typescript"; | |||
// @ts-expect-error -- TODO: Cannot find module './typestat.json'. Consider using '--resolveJsonModule' to import module with '.json' extension. |
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.
[Testing] The test should have resolveJsonModule
so this gets imported nicely.
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.
It has it... But the compiler options reading is broken. My other PR fixes it, but I'd like to have this one first so I can show that it fixes these issues :)
…errors-on-integration-tests
I'm not able to fix the ts errors by changing their tsconfig settings, because those settings are already there! The reading of tsconfig files is broken and this is a way to show it :D This PR #1542 is supposed to fix it So if it's okay let's leave the ts errors be present in the tests for now, and let's see how many of them will be fixed in that PR. Or there is #2053 which is combination of this PR and 1542. But I think it's better to go step by step. Or what do you think? :) |
OH! That totally makes sense, I missed that. Agreed - thank you :) |
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.
You are absolutely right. 🚢 !~
PR Checklist
status: accepting prs
Overview
Enables
suppressTypeErrors
on all integration tests to track potential type errors on generated code.Also, makes sure that we do not add absolute module path to the ts ignore comment as it would be different when run on different machines.