Tidy tests.

This commit is contained in:
orangemug
2018-01-10 13:19:34 +00:00
parent 942b2240a7
commit a773958403
11 changed files with 1228 additions and 1078 deletions

View File

@@ -0,0 +1,26 @@
var artifacts = require("../../artifacts");
var fs = require("fs");
var istanbulCov = require('istanbul-lib-coverage');
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__;
});
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);
})
})