Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Andrew Jones
@aljones15
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
@aljones15
kdirIfNotExists
Andrew Jones
@aljones15
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.
Manny
@mannyluvstacos
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
kc_prom
@kc_prom:matrix.org
[m]

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?

bobby2004170
@bobby2004170
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
@Krinkle

@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).

https://bugzilla.mozilla.org/show_bug.cgi?id=1635451
mozilla/gecko-dev@a8d8e90

Esteban Abaroa
@estebanabaroa
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
@muuvmuuv
Hey Team, may I ask someone from the maintainers to replace my contributors email with a proper one or completly?
Michael Odumosu
@MOdumosu_twitter
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
@georglang

Hi
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
@MOdumosu_twitter
you are not supposed to run karma start
@georglang
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
@georglang
@MOdumosu_twitter, sorry i started it with ng test and i got that message
Michael Odumosu
@MOdumosu_twitter
@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
@georglang
@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) {
  config.set({
    basePath: '',
    frameworks: ['jasmine', '@angular-devkit/build-angular'],
    plugins: [
      require('karma-jasmine'),
      require('karma-chrome-launcher'),
      require('karma-jasmine-html-reporter'),
      require('karma-coverage'),
      require('@angular-devkit/build-angular/plugins/karma'),
      require('karma-jasmine-seed-reporter'),
    ],
    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
@georglang
I created a completly new project and copied the karma.conf.js into my project, also with no success
Georg Lang
@georglang
@MOdumosu_twitter And when i run the tests with 'ng test --source-map=false' the tests were executed
Michael Odumosu
@MOdumosu_twitter
@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
@georglang
@MOdumosu_twitter do you have any ideas ?
John Bumgardner
@johnbumgardner
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