Skip to content

Commit 826bfeb

Browse files
committed
Fix code coverage reporting
1 parent 88a97e9 commit 826bfeb

6 files changed

Lines changed: 175 additions & 180 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,13 @@ jobs:
3636
- name: Run browser tests in Saucelabs
3737
run: npm run test-ci
3838
timeout-minutes: 5
39+
- name: Install lcov
40+
run: |
41+
sudo apt update
42+
sudo apt install lcov
43+
- name: Merge lcov reports
44+
run: find coverage -name lcov.info -exec echo -a \"{}\" \; | xargs lcov -o coverage/lcov.info
45+
- name: Coveralls
46+
uses: coverallsapp/github-action@master
47+
with:
48+
github-token: ${{ secrets.github_token }}

CONTRIBUTING.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

karma.conf.ci.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,10 @@ module.exports = function(config) {
101101
},
102102
coverageReporter: {
103103
type: 'lcov',
104-
dir: 'coverage'
104+
dir: 'coverage',
105+
subdir: function(browser) {
106+
return browser.toLowerCase().split(/[ /-]/)[0];
107+
}
105108
},
106109
singleRun: true
107110
});

karma.conf.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,28 @@ module.exports = function (config) {
99
'spec/*-spec.js',
1010
{ pattern: 'spec/fixtures/**', included: false }
1111
],
12-
reporters: ['spec'],
1312
port: 9876,
1413
colors: true,
1514
logLevel: config.LOG_INFO,
1615
autoWatch: true,
1716
customLaunchers: {
18-
Chrome_Travis: {
17+
Chrome_No_Sandbox: {
1918
base: 'Chrome',
2019
flags: ['--no-sandbox']
2120
}
2221
},
2322
browsers: ['PhantomJS'],
23+
reporters: ['spec', 'saucelabs', 'coverage', 'coveralls'],
24+
preprocessors: {
25+
'stack-generator.js': 'coverage'
26+
},
27+
coverageReporter: {
28+
type: 'lcov',
29+
dir: 'coverage',
30+
subdir: function(browser) {
31+
return browser.toLowerCase().split(/[ /-]/)[0];
32+
}
33+
},
2434
singleRun: false
2535
});
2636
};

0 commit comments

Comments
 (0)