Skip to content

Commit

Permalink
Test additions and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TSonono committed Nov 5, 2024
1 parent 9014ffa commit 864215d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/end-to-end-tests/single-root-UI/test/coverage.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { DefaultEnvironment, expect } from '@test/util';
import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';

// From vscode: src/vs/workbench/contrib/testing/common/testTypes.ts
const enum TestResultState {
Expand Down Expand Up @@ -59,5 +61,6 @@ suite('Coverage integration', () => {
const testResult: any = await vscode.commands.executeCommand('testing.coverage.uri', vscode.Uri.file(testEnv.projectFolder.location));
expect(testResult['tasks'][0].hasCoverage).to.be.eq(true);
expect(testResult['items'][2].computedState).to.be.eq(TestResultState.Passed);
expect(fs.existsSync(path.join(testEnv.projectFolder.location, testEnv.buildLocation, 'lcov.info'))).to.be.true;
}).timeout(60000);
});
3 changes: 2 additions & 1 deletion test/unit-tests/coverage.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { handleCoverageInfoFiles } from "@cmt/coverage";
import * as vscode from "vscode";
import { expect, getTestResourceFilePath } from "@test/util";
import * as path from "path";

suite('Coverage Handling', () => {

Expand All @@ -27,7 +28,7 @@ suite('Coverage Handling', () => {
const coverageData = new WeakMap<vscode.FileCoverage, vscode.FileCoverageDetail[]>();
await handleCoverageInfoFiles(testRun, [getTestResourceFilePath('lcov.info')], coverageData);
expect(filesCoverages.length).to.eq(1);
expect(filesCoverages[0].uri.fsPath).to.eq('/tmp/lcov/main.cpp');
expect(filesCoverages[0].uri.fsPath).to.eq(path.join(path.sep, 'tmp', 'lcov', 'main.cpp'));
const coverageDetail = coverageData.get(filesCoverages[0]);
expect(coverageDetail).to.not.be.undefined;

Expand Down

0 comments on commit 864215d

Please sign in to comment.