Skip to content

Commit a62a3fb

Browse files
committed
Fix test unit for buildHtml function; Add comments for some test coverage unit tests;
1 parent ad60a4f commit a62a3fb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/suite/testCoverage.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
buildHtml
99
} from "../../coverage/coverageService";
1010
import { readParameter } from "../../idfConfiguration";
11+
import * as fse from "fs-extra";
1112

1213
suite("Test Coverage Unit Tests", () => {
1314
const workspace = vscode.Uri.file(join(__dirname, "../../../testFiles/gcov"));
@@ -29,16 +30,18 @@ suite("Test Coverage Unit Tests", () => {
2930
assert.equal(JSON.stringify(example), JSON.stringify(pathsToFilter))
3031
})
3132

33+
// Tests if buildJson returns a double stringified object that has the following properties: "files", "gcovr/format_version"
3234
test("buildJson", async () => {
3335
const result = await buildJson(workspace);
3436
const parsedResult = JSON.parse(JSON.parse(result));
3537
assert.ok(parsedResult.files);
3638
assert.ok(parsedResult["gcovr/format_version"]);
3739
})
3840

41+
// Tests if buildHtml returns a string cointanting html content.
3942
test("buildHtml", async () => {
4043
const result = await buildHtml(workspace);
41-
console.log("RADU result", typeof result);
42-
assert.equal("", result);
44+
assert.equal(result.slice(result.length - 8), "</html>\n");
45+
assert.equal(result.slice(0,15), "<!DOCTYPE html>");
4346
})
4447
});

0 commit comments

Comments
 (0)