Fix coverage in tests.

This commit is contained in:
orangemug
2018-01-17 17:36:46 +00:00
parent bc19aea438
commit 0cec0cf595
2 changed files with 14 additions and 16 deletions

View File

@@ -7,20 +7,18 @@ var COVERAGE_PATH = artifacts.pathSync("/coverage");
var coverage = istanbulCov.createCoverageMap({});
describe("coverage", function() {
// Capture the coverage after each test
afterEach(function() {
// Code coverage
var results = browser.execute(function() {
return window.__coverage__;
});
// Capture the coverage after each test
afterEach(function() {
// Code coverage
var results = browser.execute(function() {
return window.__coverage__;
});
coverage.merge(results.value);
})
// Dump the coverage to a file
after(function() {
var jsonStr = JSON.stringify(coverage, null, 2);
fs.writeFileSync(COVERAGE_PATH+"/coverage.json", jsonStr);
})
coverage.merge(results.value);
})
// Dump the coverage to a file
after(function() {
var jsonStr = JSON.stringify(coverage, null, 2);
fs.writeFileSync(COVERAGE_PATH+"/coverage.json", jsonStr);
})