答案 0 :(得分:6)
outputFile
)必须存储在target/surefire-reports/TESTS-TestSuite.xml
答案 1 :(得分:1)
reporters : ['progress', 'junit', 'coverage'],
port : 9876,
colors : true,
logLevel : config.LOG_INFO,
// don't watch for file change
autoWatch : false,
// only runs on headless browser
browsers : ['PhantomJS'],
// just run one time
singleRun : true,
// remove `karma-chrome-launcher` because we will be running on headless
// browser on Jenkins
plugins : [
'karma-jasmine',
'karma-phantomjs-launcher',
'karma-junit-reporter',
'karma-coverage',
'karma-jenkins-reporter'
],
// changes type to `cobertura`
coverageReporter : {
type : 'cobertura',
dir : 'target/coverage-reports/'
},
// saves report at `target/surefire-reports/TEST-*.xml` because Jenkins
// looks for this location and file prefix by default.
junitReporter : {
outputDir : 'target/surefire-reports/'
}
答案 2 :(得分:0)
旧帖子,但在谷歌中排名第一。
完整示例位于this blog post。