Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
Timo Tijhof
I believe karma-coverage takes care of that. Last I checked it stores the result of each browser in a separate sub directory like coverage/Firefox and coverage/Chromium. It might be that you have set the directory explicitly, in which case they could get overridden.

I believe karma-coverage takes care of that. Last I checked it stores the result of each browser in a separate sub directory like coverage/Firefox and coverage/Chromium. It might be that you have set the directory explicitly, in which case they could get overridden.

I see, thanks!

Kahn Le
The Karma js was using the "ua-parser-js" package, The package has a security issue, Do you have a plan to change using the package to another for safety?
Andrew Jones
hey folks not sure why, but karma-coverage is not writing the html report to the dir specified. If I got into node_modules and manually tell exectureReport -> report.execute() then it does write the html, but I can't seem to find where the actual call is made to write the html report to a file with out me modifying karma-coverage.
basically istanbul reporter's write function is never being called
that helper is not firing for some reason
Andrew Jones
Andrew Jones
if anyone else runs into this: easiest way around it to not use karma-coverage and just another coverage reporter with the webpack instanbul loader.
Hi all! I wanted to bring awareness to a karma-runner/karma#3740 to protect from the security vuln introduced in 1.4.1.
If any maintainers have the time/capacity to review and merge, that would be greatly appreciated! :)
1 reply

hey, quick question: I've got an angular 4 app I've inherited and while I got the tests consistently running and above 80% it takes 15+ min to run all the tests.

prior to doing any massive changes to optimize things i figured i would try for concurrency to see fi i could get a 2-3x multiplier to the speed.

I am using a recent version of Karma(6.3.4) and i notice that i should have some concurrency by default(infinity) even when i override that with an integer(3) i still only see one browser instance opening.

anyone have an idea what could cause the runner to not run concurrently?

Hi Team,
I need to add tests for some project with uses a javascript 3d library that uses WebGL.I am using Karma test runner and using firefox headless mode . by default, the WebGl support was disabled in headless mode of the browser. Is there a way to enable WebGL in headless firefox mode?
Timo Tijhof

@bobby2004170 The launcher for Firefox lives at https://github.com/karma-runner/karma-firefox-launcher. It seems WebGL was not disabled there, but rather it is (or was) disabled in upstream Firefox itself when in Headless mode, thus there is no way for us to enable it other than to launch "Firefox" instead of "FirefoxHeadless" (this should work locally but may require Xvfb in CI or other virtual contexts).

I do note that there is a bugzilla ticket for this, according to which WebGL is no longer disabled for Firefox on macOS and Windows as of Firefox 91 (released Aug 2021).


Esteban Abaroa
Anyone knows how I can use the debug package https://www.npmjs.com/package/debug with karma? You need to add localStorage.debug = 'something:*' and refresh the page, what would be the best way to do this with karma? Ideally it would add it before every test based on some env variable
Marvin Heilemann
Hey Team, may I ask someone from the maintainers to replace my contributors email with a proper one or completly?
Michael Odumosu
Hey is anyone available I am trying to write a custom karma launcher for Microsoft edge and there is no clear guide or documentation on how this works can someone please help
Georg Lang

I'm running karma start inside an angular 13 app and I get the following error :
You need to include some adapter that implements __karma__.start method!

dependencies have the following versions:

    "karma": "~6.3.17",
    "karma-chrome-launcher": "~3.1.1",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",

Can anyone help me, please ?

Michael Odumosu
you are not supposed to run karma start
its npx ng test
angular is the framework and all your work should be done with the angular CLI (command line interface) that means you should have no business messing with its 3rd party packages or you are doing something wrong!! :)
who can I talk to about providing a karma runner for Microsoft edge?
Georg Lang
@MOdumosu_twitter, sorry i started it with ng test and i got that message
Michael Odumosu
@georglang uninstall npm packages and reinstall, if that doesn't work check your karma.conf.js and make sure the plugins are state properly as in the template
Georg Lang
@MOdumosu_twitter thanks for your answer, i tried reinstalling the packages multiple times but unfortunately with no success.
Here is my karma.conf.js:
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html

module.exports = function (config) {
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
    client: {
      jasmine: {
        // you can add configuration options for Jasmine here
        // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
        // for example, you can disable the random execution with `random: false`
        // or set a specific seed with `seed: 4321`
      clearContext: false, // leave Jasmine Spec Runner output visible in browser
    jasmineHtmlReporter: {
      suppressAll: true, // removes the duplicated traces
    coverageReporter: {
      dir: require('path').join(__dirname, './output/coverage/try'),
      subdir: '.',
      reporters: [{ type: 'html' }, { type: 'lcov', file: 'lcov.info' }],
    reporters: ['progress', 'kjhtml', 'jasmine-seed'],
    port: 9876,
    colors: true,
    logLevel: config.LOG_INFO,
    autoWatch: true,
    browsers: ['Chrome'],
    singleRun: false,
    restartOnFileChange: true,
    customLaunchers: {
      ChromeHeadless: {
        base: 'Chrome',
        flags: ['--headless', '--disable-gpu', '--remote-debugging-port=9222', '--no-sandbox'],
Georg Lang
I created a completly new project and copied the karma.conf.js into my project, also with no success
Georg Lang
@MOdumosu_twitter And when i run the tests with 'ng test --source-map=false' the tests were executed
Michael Odumosu
@georglang yep javascript is a bad language I took out detectChanges from my code and some how it caused a expression_changed after checked error in another component!
Georg Lang
@MOdumosu_twitter do you have any ideas ?
John Bumgardner
hey guys not sure how active this chat is, but i had a dependabot vulnerability related to socket.io parser in karma. i opened a PR in karma to address it if yall could take a look