88 buildHtml
99} from "../../coverage/coverageService" ;
1010import { readParameter } from "../../idfConfiguration" ;
11+ import * as fse from "fs-extra" ;
1112
1213suite ( "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