[go: nahoru, domu]

Skip to content
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

API: Attributable Test Coverage #212196

Open
connor4312 opened this issue May 7, 2024 · 3 comments
Open

API: Attributable Test Coverage #212196

connor4312 opened this issue May 7, 2024 · 3 comments
Assignees
Labels
api-finalization feature-request Request for new features or functionality test-coverage testing Built-in testing support
Milestone

Comments

@connor4312
Copy link
Member
connor4312 commented May 7, 2024

For a variety of reasons, it may be useful to know what tests generated what coverage. So let's add some API for that in the form of a second optional parameter for addCoverage.

declare module 'vscode' {
	export class FileCoverage2 extends FileCoverage {
		/**
		 * Test {@link TestItem} this file coverage is generated from. If undefined,
		 * the editor will assume the coverage is the overall summary coverage for
		 * the entire file.
		 *
		 * If per-test coverage is available, an extension should append multiple
		 * `FileCoverage` instances with this property set for each test item. It
		 * must also append a `FileCoverage` instance without this property set to
		 * represent the overall coverage of the file.
		 */
		testItem?: TestItem;


		constructor(
			uri: Uri,
			statementCoverage: TestCoverageCount,
			branchCoverage?: TestCoverageCount,
			declarationCoverage?: TestCoverageCount,
			testItem?: TestItem,
		);
	}
}
@connor4312 connor4312 added feature-request Request for new features or functionality api-proposal testing Built-in testing support test-coverage labels May 7, 2024
@connor4312 connor4312 added this to the May 2024 milestone May 7, 2024
@connor4312 connor4312 self-assigned this May 7, 2024
@connor4312
Copy link
Member Author

Peek at initial UI: #212403

@sanket-bhalerao
Copy link

is this feature limited to code for vscode or other projects can utilize this for their test coverage?

@connor4312
Copy link
Member Author

Once the API is finalized, anyone can use it. It is subject to change until then, but we encourage folks to try it out and let us know how it works for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-finalization feature-request Request for new features or functionality test-coverage testing Built-in testing support
Projects
None yet
Development

No branches or pull requests

2 participants