Add JUnit test reporter for karma.

This commit is contained in:
Robert Zhang 2019-09-06 15:16:59 +08:00
Родитель be3f6eb197
Коммит 182f7d6f9f
4 изменённых файлов: 28 добавлений и 2 удалений

2
.gitignore поставляемый
Просмотреть файл

@ -44,3 +44,5 @@ testem.log
# System Files
.DS_Store
Thumbs.db
unit-test-result.xml

Просмотреть файл

@ -10,7 +10,8 @@ module.exports = function (config) {
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
require('@angular-devkit/build-angular/plugins/karma'),
require('karma-junit-reporter'),
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
@ -21,6 +22,10 @@ module.exports = function (config) {
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
junitReporter: {
outputFile: 'unit-test-result.xml',
useBrowserName: false,
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,

18
package-lock.json сгенерированный Normal file → Executable file
Просмотреть файл

@ -6235,6 +6235,24 @@
"integrity": "sha512-7g0gPj8+9JepCNJR9WjDyQ2RkZ375jpdurYQyAYv8PorUCadepl8vrD6LmMqOGcM17cnrynBawQYZHaumgDjBw==",
"dev": true
},
"karma-junit-reporter": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-1.2.0.tgz",
"integrity": "sha1-T5xAzt+xo5X4rvh2q/lhiZF8Y5Y=",
"dev": true,
"requires": {
"path-is-absolute": "^1.0.0",
"xmlbuilder": "8.2.2"
},
"dependencies": {
"xmlbuilder": {
"version": "8.2.2",
"resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz",
"integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=",
"dev": true
}
}
},
"karma-source-map-support": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/karma-source-map-support/-/karma-source-map-support-1.4.0.tgz",

3
package.json Normal file → Executable file
Просмотреть файл

@ -28,9 +28,9 @@
"@angular/cli": "~8.2.1",
"@angular/compiler-cli": "~8.2.0",
"@angular/language-service": "~8.2.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
@ -39,6 +39,7 @@
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"karma-junit-reporter": "^1.2.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",