-
-
Notifications
You must be signed in to change notification settings - Fork 8
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: adjust createSourceFileAndTypeChecker
to verify passed code has valid syntax
#703
test: adjust createSourceFileAndTypeChecker
to verify passed code has valid syntax
#703
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #703 +/- ##
==========================================
- Coverage 77.20% 77.08% -0.12%
==========================================
Files 50 50
Lines 5000 5009 +9
Branches 687 688 +1
==========================================
+ Hits 3860 3861 +1
- Misses 1139 1147 +8
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
if (diagnostics.length > 0) { | ||
throw new Error( | ||
ts.flattenDiagnosticMessageText( | ||
diagnostics[0].messageText, |
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.
Showing a single error each time seems easier to handle.
createSourceFileAndTypeChecker
to verify passed code has valid syntaxcreateSourceFileAndTypeChecker
to verify passed code has valid syntax
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.
!
And yeah I don't mind the coverage gap here, seems reasonable to ignore test files. I think in general it's good to check that test if
s inline in tests aren't unnecessary - sometimes folks use them to get around type checking. But for this, not so useful IMO.
@all-contributors please add @ronami for test.
|
I've put up a pull request to add @ronami! 🎉 |
Adds @ronami as a contributor for test. This was requested by JoshuaKGoldberg [in this comment](#703 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
PR Checklist
status: accepting prs
Overview
This is a small follow-up to #698 (comment), and it adjusts the test helper
createSourceFileAndTypeChecker
to check that passed syntax is valid (to prevent accidental invalid syntax on test cases).I've checked locally that this would fail before the change on the linked comment.
Codecov fails on this, but I don't think there's much to do (it's a test helper, should it even be included in the codecov report?).