Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
Added test for CoverageHTMLReporter
tests overwriting of assets and title
  • Loading branch information
pesse committed Mar 20, 2018
commit aabee4ec5235b0ebe7c3950d81a765468806c11e
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,22 @@ public void coverageReporterWriteAssetsToOutput() throws Exception {

runCmd.run();

// Run twice to test overriding of assets
runCmd = RunCommandTestHelper.createRunCommand(RunCommandTestHelper.getConnectionString(),
"-f=ut_coverage_html_reporter", "-o=" + coveragePath, "-s");

runCmd.run();

// Check application file exists
File applicationJs = coverageAssetsPath.resolve(Paths.get("application.js")).toFile();
assertTrue(applicationJs.exists());

// Check correct script-part in HTML source exists
String content = new Scanner(coveragePath).useDelimiter("\\Z").next();
assertTrue(content.contains("<script src='" + coverageAssetsPath.toString() + "/application.js' type='text/javascript'>"));

// Check correct title exists
assertTrue(content.contains("<title>Code coverage</title>"));
}

@AfterEach
Expand Down