Our team writes JavaScript unit tests using Jasmine. We are setting up codebase analysis in SonarQube. The SonarQube JavaScript plugin documentation says that it will use unit test results only in the format that is generated by JS Test Driver. I'm using Karma already for generating the LCOV report but to my surprise I can't find a reporter that generate the collection of TEST-*.xml files that JS Test Driver generates. Please advise.
2
There are 2 best solutions below
0
Anthony Watson
On
I just wrote an open source SonarQube plugin to take the output of the karma-junit-reporter plugin and allow its output to be populated into SonarQube. You can find it in the here: https://github.com/acwatson/sonar-karma-test-report-plugin
Related Questions in JAVASCRIPT
- Using Puppeteer to scrape a public API only when the data changes
- inline SVG text (js)
- An array of images and a for loop display the buttons. How to assign each button to open its own block by name?
- Storing the preferred font-size in localStorage
- Simple movie API request not showing up in the console log
- Authenticate Flask rest API
- Deploying sveltekit app with gunjs on vercel throws cannot find module './lib/text-encoding'
- How to request administrator rights?
- mp4 embedded videos within github pages website not loading
- Scrimba tutorial was working, suddenly stopped even trying the default
- In Datatables, start value resets to 0, when column sorting
- How do I link two models in mongoose?
- parameter values only being sent to certain columns in google sheet?
- Run main several times of wasm in browser
- Variable inside a Variable, not updating
Related Questions in JASMINE
- Angular HttpTestingController testing response type blob error responses
- Are test.ts and test-acceptance.ts not required from Angularv15 onwards?
- Angular Plotly test TypeError: Cannot read properties of undefined (reading 'data') PlotlyComponent.createFigure
- Angular unit test spyon
- jasmine-browser-runner with Rails 5 app. serve command giving localhost didn’t send any data
- Karma - Jasmine configuration in Aurelia 1 - disconnected after timeout
- Angular signal testing with Jasmin and Karma
- How do you find the stack trace of a JavaScript Promise that never resolves?
- How to mock/override a method defined in base class in angular
- Error: [$injector:modulerr] Failed to instantiate module in FE unit tests when adding typescript
- Make package.json scripts work on both macOS and Windows
- Spec file calling real service despite having a mock spy implementation
- <select> element property "value" not detected by Jasmine in test cases
- Selenium-Webdriver gives unhelpful stacktrace
- How to mock & Inject functions with dependencies in my case httpsCallable from rxfire for unit test
Related Questions in SONARQUBE
- Sonarqube not allowing me to set policy for S3 bucket
- Jacoco Coverage in Multi-Module Gradle Project Not Including Submodules
- How to solve sonarqube issue based on bug to return a copy
- Java Code Coverage with both Jacoco & SonarQube
- Sonar qube i installed is not working and it show "...... Try: Checking the connection Checking the proxy and the firewall ERR_CONNECTION_REFUSED"
- SonarLint vs code error of skipping files
- Sonar qube container cannot authenticate with token
- Is there a Sonar-Elixir plugin compatible with SonarQube 10.4.1?
- Error: LinkageError occurred while loading main class org.sonarsource.scanner.cli.Main
- SonarQube: False-Positive S100 - Method names should comply with a naming convention
- Sonarcloud - Sonar warning - Accept button - "Valid issue but won't be fixed now, it's acceptable for a while."
- What refactoring should I apply on this email validation regex?
- Flutter SonarQube: "The main branch has no lines of code."
- SonarScan not recognising python code at the source directory
- How is this passing the quality gate
Related Questions in KARMA-RUNNER
- Angular 15 unit test - Cannot read properties of readonly constant, why?
- Are test.ts and test-acceptance.ts not required from Angularv15 onwards?
- Karma with external stencil webcomponents
- Karma tests do not run because there is no webpack loader for .css files
- Karma - Jasmine configuration in Aurelia 1 - disconnected after timeout
- Angular Mocking Service with multiple signature
- CreateSpyObject works in "beforeEach" but not in "it"
- Why does all the Jasmine related it, describe, beforeEach are marked as "Cannot find name ********"?
- Angular + Jasmine - Provider not applied to inner component
- Should we upgrade Jasmine and Karma related dependencies too during Angular upgrade?
- With Mathjax-angular, getting TypeError: Cannot read properties of undefined (reading 'then')
- Karma Test Error: Disconnected, because no message in 60000 ms
- An error was thrown in afterAll Uncaught TypeError: Cannot read properties of undefined (reading 'BASE_URL')
- ng test with Angular 16 fails with TypeError: The 'compilation' argument must be an instance of Compilation (on mac)
- Unit test case in angular for polling api call until the data is received
Related Questions in JS-TEST-DRIVER
- Is it possible to test a .each(function()) statement?
- How to include "require" in PhpStorm for my JavaScript code?
- How to fix issue of code coverage not finding functions when run tests do?
- How to stop Code Coverage from crashing because of sinon even though tests without code coverage pass?
- Polymer test fails with "chrome failed to maximize"
- Need help in creating JUNIT test for this piece of code
- Test config file - newbee issues
- JsTestDriver on NetBeans stops testing after a failed assertion
- No browsers available, yet actions requested?
- How can I use jsTestDriver in jetBrains?
- How do I get the total price from my carList?
- JavaScript Unit Tests not working on SonarQube
- Is it a bug in SonarQube's JavaScript plugin that it doesn't pick up Surefire test results of tests that are in a subdirectory?
- Does there exist a Karma Reporter that generates JS Test Driver format results so that SonarQube can pick them up?
- Is it possible to get autocompletion and intellisense for JsTestDriver in Eclipse?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
@SBel - This is something that even I am attempting to do. I have read a few articles and yes there is a plugin for Karma which generates these Test-*.xml files. The karma plugin is documented here https://github.com/karma-runner/karma-junit-reporter.
Looks like there has been a little history linked to this Sonar feature. This capability was removed and re-added recently in version 2.2 of the java script plugin.
I found these links to be useful. Links 1 & 2 should answer your question.
http://blog.akquinet.de/2014/11/25/js-test-coverage/
How to tell Sonar to use my surefire reports for unit test results