Gathering detailed insights and metrics for karma-junit-reporter
Gathering detailed insights and metrics for karma-junit-reporter
Gathering detailed insights and metrics for karma-junit-reporter
Gathering detailed insights and metrics for karma-junit-reporter
@types/karma-junit-reporter
TypeScript definitions for karma-junit-reporter
karma-dedup-junit-reporter
Wrapper around the karma junit reporter that adds a number to each spec
junit-report-merger
Merges multiple JUnit XML reports into one.
jest-junit
A jest reporter that generates junit xml files
A Karma plugin. Report results in junit xml format.
npm install karma-junit-reporter
51.5
Supply Chain
94.1
Quality
75.4
Maintenance
100
Vulnerability
98.2
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
178 Stars
150 Commits
144 Forks
12 Watching
33 Branches
49 Contributors
Updated on 19 Nov 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-3.4%
112,142
Compared to previous day
Last week
1.3%
570,695
Compared to previous week
Last month
8.4%
2,374,711
Compared to previous month
Last year
1.8%
26,636,432
Compared to previous year
2
1
Reporter for the JUnit XML format.
The easiest way is to keep karma-junit-reporter
as a devDependency in your package.json
. Just run
1npm install karma-junit-reporter --save-dev
to let npm automatically add it there.
1// karma.conf.js 2module.exports = function(config) { 3 config.set({ 4 reporters: ['progress', 'junit'], 5 6 // the default configuration 7 junitReporter: { 8 outputDir: '', // results will be saved as $outputDir/$browserName.xml 9 outputFile: undefined, // if included, results will be saved as $outputDir/$browserName/$outputFile 10 suite: '', // suite will become the package name attribute in xml testsuite element 11 useBrowserName: true, // add browser name to report and classes names 12 nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element 13 classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element 14 properties: {}, // key value pair of properties to add to the <properties> section of the report 15 xmlVersion: null // use '1' if reporting to be per SonarQube 6.2 XML format 16 } 17 }); 18};
You can pass list of reporters as a CLI argument too:
1karma start --reporters junit,dots
To make this possible, it's required to make the classnames of each tests to match its file name.
For Example:
1describe('analytics.AnalyticsModule_test', function(){ 2 3 var analytics; 4 beforeEach(module('ECApp')); 5 beforeEach(module('angularytics')); 6 beforeEach(module('AnalyticsModule')); 7...
should have a file name AnalyticsModule_test.js
This will produce test result with schema acceptable in sonar.
Grunt file reporters property example:
1reporters: ['junit', 'coverage', 'progress'], 2junitReporter: { 3 outputDir: $junitResults, 4 suite: 'models' 5}, 6coverageReporter: { 7 type: 'lcov', 8 dir: $coverageOutputDir, 9 subdir: '.' 10}, 11preprocessors: { 12 'src/main/webapp/public/js/ec3.3/**/*.js': 'coverage', 13 'src/main/webapp/public/js/ec3/**/*.js': 'coverage' 14}, 15plugins: [ 16 'karma-jasmine', 17 'karma-phantomjs-launcher', 18 'ec-karma-junit-reporter23', 19 'karma-coverage' 20]
Sonar property example:
sonar.projectName=js
sonar.sources=site-main-php/src/main/webapp/public/js
sonar.projectBaseDir=.
sonar.exclusions=site-main-php/src/main/webapp/public/js/lib/*.js,site-main-php/src/main/webapp/public/js/tests/**/*.php,site-main-php/src/main/webapp/public/js/tests/**/*.js,site-main-php/src/main/webapp/public/js/ec3.3/vendor/**
sonar.javascript.lcov.reportPath=site-main-php/target/coverage/lcov.info
sonar.javascript.jstestdriver.reportsPath=site-main-php/target/surefire-reports/
sonar.tests=site-main-php/src/main/webapp/public/js/tests
Example junit xml report:
1<?xml version="1.0"?> 2<testsuite name="PhantomJS 1.9.8 (Linux)" package="models" timestamp="2015-03-10T13:59:23" id="0" hostname="admin" tests="629" errors="0" failures="0" time="11.452"> 3 <properties> 4 <property name="browser.fullName" value="Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.8 Safari/534.34"/> 5 </properties> 6 <testcase name="(C.2) Checks if an empty object is returned when error 404 is encountered" time="0.01" classname="PhantomJS_1_9_8_(Linux).models.AnalyticsModule_test"/> 7 <testcase name="(C.3) Checks if an empty array is returned when error 405 is encountered" time="0.013" classname="PhantomJS_1_9_8_(Linux).models.AnalyticsModule_test"/> 8</testsuite> 9...
For more information on Karma see the homepage.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 10/22 approved changesets -- score normalized to 4
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More