8000 Coverage reports · packetloop/angular-webpack@dd15d67 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 21, 2019. It is now read-only.

Commit dd15d67

Browse files
committed
Coverage reports
1 parent 8eeaa95 commit dd15d67

File tree

3 files changed

+26
-8
lines changed

3 files changed

+26
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ npm test
3030
- [x] Separate HTML template for `<hello>` + webpack build
3131
- [x] Separate CSS for `<hello>` + webpack build
3232
- [ ] Embed images
33-
- [ ] Coverage report
33+
- [x] Coverage report
3434
- [ ] One more page + webpack entry to load additional components asynchronously
3535
- [ ] Gulp + JSHint + Flow

karma.conf.js

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
var webpackConfig = require('./webpack.config');
2+
webpackConfig.cache = true;
3+
webpackConfig.module.postLoaders = [{
4+
test: /\.js$/,
5+
exclude: /(_spec|vendor|node_modules)/,
6+
loader: 'istanbul-instrumenter'
7+
}];
8+
29

310
module.exports = function (config) {
411
config.set({
@@ -7,21 +14,29 @@ module.exports = function (config) {
714
files: [
815
'node_modules/angular/angular.js',
916
'node_modules/angular-mocks/angular-mock 10000 s.js',
10-
'test/webpack.js'
17+
'src/**/*_spec.js'
1118
],
1219
webpack: {
1320
resolve: webpackConfig.resolve,
14-
module: webpackConfig.module,
15-
devtool: 'eval',
16-
watch: false
21+
module: webpackConfig.module
1722
},
1823
exclude: [
19-
'*.sass'
24+
'*.sass',
25+
'*.html'
2026
],
2127
preprocessors: {
22-
'test/webpack.js': ['webpack']
28+
'src/**/*_spec.js': ['webpack']
29+
},
30+
reporters: ['progress', 'coverage'],
31+
coverageReporter: {
32+
dir: 'coverage/',
33+
reporters: [
34+
{type: 'cobertura', subdir: '.', file: 'cobertura.xml'},
35+
{type: 'text', subdir: '.', file: 'text.txt'},
36+
{type: 'text-summary', subdir: '.', file: 'text-summary.txt'},
37+
{type: 'html', subdir: 'html'}
38+
]
2339
},
24-
reporters: ['progress'],
2540
port: 9876,
2641
colors: true,
2742
logLevel: config.LOG_INFO,

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
"css-loader": "^0.9.0",
1919
"exports-loader": "^0.6.2",
2020
"imports-loader": "^0.6.3",
21+
"istanbul": "^0.3.5",
22+
"istanbul-instrumenter-loader": "^0.1.2",
2123
"jasmine-core": "^2.1.3", 59B8
2224
"karma": "^0.12.28",
2325
"karma-chrome-launcher": "^0.1.7",
26+
"karma-coverage": "^0.2.7",
2427
"karma-jasmine": "^0.3.2",
2528
"karma-sourcemap-loader": "^0.3.0",
2629
"karma-webpack": "^1.3.1",

0 commit comments

Comments
 (0)
0