mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2024-12-27 11:35:24 +01:00
Fix coverage in tests.
This commit is contained in:
parent
bc19aea438
commit
0cec0cf595
2 changed files with 14 additions and 16 deletions
|
@ -24,6 +24,6 @@ jobs:
|
||||||
- run: mkdir -p /tmp/artifacts/logs
|
- run: mkdir -p /tmp/artifacts/logs
|
||||||
- run: DOCKER_HOST=localhost npm test
|
- run: DOCKER_HOST=localhost npm test
|
||||||
- run: npm run build
|
- run: npm run build
|
||||||
- run: npm test
|
- run: ./node_modules/.bin/istanbul report --include /tmp/artifacts/coverage/coverage.json --dir /tmp/artifacts/coverage html lcov
|
||||||
- store_artifacts:
|
- store_artifacts:
|
||||||
path: /tmp/artifacts
|
path: /tmp/artifacts
|
||||||
|
|
|
@ -7,20 +7,18 @@ var COVERAGE_PATH = artifacts.pathSync("/coverage");
|
||||||
|
|
||||||
var coverage = istanbulCov.createCoverageMap({});
|
var coverage = istanbulCov.createCoverageMap({});
|
||||||
|
|
||||||
describe("coverage", function() {
|
// Capture the coverage after each test
|
||||||
// Capture the coverage after each test
|
afterEach(function() {
|
||||||
afterEach(function() {
|
// Code coverage
|
||||||
// Code coverage
|
var results = browser.execute(function() {
|
||||||
var results = browser.execute(function() {
|
return window.__coverage__;
|
||||||
return window.__coverage__;
|
});
|
||||||
});
|
|
||||||
|
|
||||||
coverage.merge(results.value);
|
coverage.merge(results.value);
|
||||||
})
|
})
|
||||||
|
|
||||||
// Dump the coverage to a file
|
// Dump the coverage to a file
|
||||||
after(function() {
|
after(function() {
|
||||||
var jsonStr = JSON.stringify(coverage, null, 2);
|
var jsonStr = JSON.stringify(coverage, null, 2);
|
||||||
fs.writeFileSync(COVERAGE_PATH+"/coverage.json", jsonStr);
|
fs.writeFileSync(COVERAGE_PATH+"/coverage.json", jsonStr);
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue