Skip to content

Commit 1cef4de

Browse files
committed
Added html unit test reporter.
Close to terminal, easier to browser and find failing tests
1 parent 6894819 commit 1cef4de

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ vendor/
77
.idea/
88
coverage/
99
.coverage
10-
karma/karma.conf.js
10+
karma/karma.conf.js
11+
html_tests/

karma/karma-unit.tpl.js

+12-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ module.exports = function ( karma ) {
3434
"karma-coverage",
3535
"karma-threshold-reporter",
3636
"karma-coffee-preprocessor",
37-
"karma-mocha-reporter"
37+
"karma-mocha-reporter",
38+
"karma-htmlfile-reporter"
3839
],
3940

4041
preprocessors: {
@@ -49,7 +50,8 @@ module.exports = function ( karma ) {
4950
"progress",
5051
"coverage",
5152
"threshold",
52-
"mocha"
53+
"mocha",
54+
"html"
5355
],
5456

5557
/**
@@ -83,6 +85,14 @@ module.exports = function ( karma ) {
8385
"Chrome"
8486
],
8587

88+
htmlReporter: {
89+
outputFile: "html_tests/units.html",
90+
91+
// Optional
92+
pageTitle: "Unit Tests",
93+
subPageTitle: "A sample project description"
94+
},
95+
8696
coverageReporter: {
8797
dir: "coverage/",
8898
reporters: [

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"karma-sauce-launcher": "^0.2.14",
4646
"karma-spec-reporter": "0.0.13",
4747
"karma-threshold-reporter": "^0.1.12",
48-
"phantomjs": "^1.9.7-8"
48+
"phantomjs": "^1.9.7-8",
49+
"karma-htmlfile-reporter": "~0.2.2"
4950
}
5051
}

0 commit comments

Comments
 (0)