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

Stubs TestRunProfile loadDetailedCoverageForTest #14599

Merged
merged 1 commit into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/plugin-ext/src/plugin/types-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3417,6 +3417,7 @@ export class FileCoverage {
public statementCoverage: TestCoverageCount,
public branchCoverage?: TestCoverageCount,
public declarationCoverage?: TestCoverageCount,
public includesTests?: theia.TestItem[],
) { }
}

Expand Down
33 changes: 33 additions & 0 deletions packages/plugin/src/theia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16547,6 +16547,30 @@ export module '@theia/plugin' {
*/
loadDetailedCoverage?: (testRun: TestRun, fileCoverage: FileCoverage, token: CancellationToken) => Thenable<FileCoverageDetail[]>;

/**
* An extension-provided function that provides detailed statement and
* function-level coverage for a single test in a file. This is the per-test
* sibling of {@link TestRunProfile.loadDetailedCoverage}, called only if
* a test item is provided in {@link FileCoverage.includesTests} and only
* for files where such data is reported.
*
* Often {@link TestRunProfile.loadDetailedCoverage} will be called first
* when a user opens a file, and then this method will be called if they
* drill down into specific per-test coverage information. This method
* should then return coverage data only for constructs the given test item
* executed during the test run.
*
* The {@link FileCoverage} object passed to this function is the same
* instance emitted on {@link TestRun.addCoverage} calls associated with this profile.
*
* @param testRun The test run that generated the coverage data.
* @param fileCoverage The file coverage object to load detailed coverage for.
* @param fromTestItem The test item to request coverage information for.
* @param token A cancellation token that indicates the operation should be cancelled.
* @stubbed
*/
loadDetailedCoverageForTest?: (testRun: TestRun, fileCoverage: FileCoverage, fromTestItem: TestItem, token: CancellationToken) => Thenable<FileCoverageDetail[]>;

/**
* Deletes the run profile.
*/
Expand Down Expand Up @@ -17141,6 +17165,13 @@ export module '@theia/plugin' {
*/
declarationCoverage?: TestCoverageCount;

/**
* A list of {@link TestItem test cases} that generated coverage in this
* file. If set, then {@link TestRunProfile.loadDetailedCoverageForTest}
* should also be defined in order to retrieve detailed coverage information.
*/
includesTests?: TestItem[];

/**
* Creates a {@link FileCoverage} instance with counts filled in from
* the coverage details.
Expand All @@ -17156,12 +17187,14 @@ export module '@theia/plugin' {
* used to represent line coverage.
* @param branchCoverage Branch coverage information
* @param declarationCoverage Declaration coverage information
* @param includesTests Test cases included in this coverage report, see {@link includesTests}
*/
constructor(
uri: Uri,
statementCoverage: TestCoverageCount,
branchCoverage?: TestCoverageCount,
declarationCoverage?: TestCoverageCount,
includesTests?: TestItem[],
);
}

Expand Down
Loading