Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo committed Dec 15, 2023
1 parent 333d442 commit 61aaef5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/controller/testController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ export const runTests: (request: TestRunRequest, option: IRunOption) => any = in
}

const run: TestRun = testController!.createTestRun(request);
const coverageProvider = new JavaTestCoverageProvider();
const coverageProvider: JavaTestCoverageProvider = new JavaTestCoverageProvider();
try {
await new Promise<void>(async (resolve: () => void): Promise<void> => {
const token: CancellationToken = option.token ?? run.token;
Expand Down
8 changes: 5 additions & 3 deletions src/provider/JavaTestCoverageProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,20 @@ export class JavaTestCoverageProvider implements TestCoverageProvider {
}

for (const sourceFileCoverage of sourceFileCoverages) {
const uri = Uri.file(Uri.parse(sourceFileCoverage.uriString).fsPath);
const uri: Uri = Uri.file(Uri.parse(sourceFileCoverage.uriString).fsPath);
const detailedCoverage: DetailedCoverage[] = [];
for (const lineCoverage of sourceFileCoverage.lineCoverages) {
const branchCoverages: BranchCoverage[] = [];
for (const branchCoverage of lineCoverage.branchCoverages) {
branchCoverages.push(new BranchCoverage(branchCoverage.hit, new Position(lineCoverage.lineNumber - 1, 0)));
}
const statementCoverage = new StatementCoverage(lineCoverage.hit, new Position(lineCoverage.lineNumber - 1, 0), branchCoverages);
const statementCoverage: StatementCoverage = new StatementCoverage(lineCoverage.hit,
new Position(lineCoverage.lineNumber - 1, 0), branchCoverages);
detailedCoverage.push(statementCoverage);
}
for (const methodCoverage of sourceFileCoverage.methodCoverages) {
const functionCoverage = new FunctionCoverage(methodCoverage.name, methodCoverage.hit, new Position(methodCoverage.lineNumber - 1, 0));
const functionCoverage: FunctionCoverage = new FunctionCoverage(methodCoverage.name, methodCoverage.hit,
new Position(methodCoverage.lineNumber - 1, 0));
detailedCoverage.push(functionCoverage);
}
fileCoverages.push(FileCoverage.fromDetails(uri, detailedCoverage));
Expand Down
5 changes: 3 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.

import { Range, TestItem, TestRun, TestRunProfile, WorkspaceFolder } from 'vscode';
import { Range, TestItem, TestRun, TestRunProfile } from 'vscode';
import * as vscode from 'vscode';

export interface IJavaTestItem {
children: IJavaTestItem[];
Expand Down Expand Up @@ -54,7 +55,7 @@ export interface IRunTestContext {
projectName: string;
testItems: TestItem[];
testRun: TestRun;
workspaceFolder: WorkspaceFolder;
workspaceFolder: vscode.WorkspaceFolder;
profile?: TestRunProfile;
}

Expand Down
2 changes: 1 addition & 1 deletion src/utils/launchUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export async function resolveLaunchConfigurationForRunner(runner: BaseRunner, te
}

if (testContext.profile?.label.includes('Coverage')) {
let agentArg = `-javaagent:${getJacocoAgentPath()}=destfile=${getJacocoDataFilePath(launchArguments.projectName)}`;
let agentArg: string = `-javaagent:${getJacocoAgentPath()}=destfile=${getJacocoDataFilePath(launchArguments.projectName)}`;
if (config?.coverage?.appendResult === false) {
agentArg += ',append=false';
}
Expand Down

0 comments on commit 61aaef5

Please sign in to comment.