-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Stub TestCoverage API #13631
Stub TestCoverage API #13631
Conversation
@rschnekenbu we should at least have a test plugin that exercises the stubbed code: extensions should at least not crash when they call the API. |
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.
The FileCoverage
API is weird in that you can assign to the public fields, but changes to those fields are not handled. Seems to be that same in VS Code, though. Seems undercooked for a GA API on their side, IMO.
constructor(public name: string, public executed: number | boolean, public location: Position | Range) { } | ||
} | ||
@es5ClassCompat | ||
export class TestCoverageCount implements theia.TestCoverageCount { |
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.
theia.TestCoverageCount
is not an interface. Why the "implements"?
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 removed this declaration, that indeed makes no sense.
} | ||
|
||
export namespace StatementCoverage { | ||
export function is(coverage: unknown): coverage is StatementCoverage { |
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.
Wouldn't instanceof
work just as well, since this is a class?
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.
Good catch, I removed this namespace addition in favor of a instanceof.
I addressed the review comments in a following patch. To run the extension:
|
contributed on behalf of STMicroelectronics Signed-off-by: Remi Schnekenburger <rschnekenburger@eclipsesource.com>
37769aa
to
6fd0939
Compare
What it does
Stub the new API introduced with vscode 1.88 about TestCoverage. This was previously a proposed API.
Fixes #13549
Contributed on behalf of STMicroelectronics
How to test
I did not have a testing plugin yet, as usual plugins used for testing are not implementing the coverage API. For example, Playwright does not yet implement code coverage as seen here: microsoft/playwright#30298.
Follow-ups
Implement TestCoverage API. This will be tracked as a task of #12010.
Review checklist
Reminder for reviewers