karma-runner / karma-qunit

A Karma plugin. Adapter for QUnit testing framework.
MIT License
51 stars 38 forks source link

chore: Simplify karma browsers config #146

Closed Krinkle closed 2 years ago

Krinkle commented 3 years ago

The "Firefox" and "HeadlessChrome" arrays were unreachable as env.CI was not set in one place and then unset in the other.

If there is reason to cover Firefox and Chrome for this project specifically we can always test both in parallel, but I'm not aware of such reason.

This commit follows CI's lead and makes local development use the same browser (Firefox) which has the benefit of working headlessly out-of-the-box both on bare metal desktops. and in e.g. a Docker container developer environment without needing local, and in CI VMS - without needing custom overrides or configs (e.g. --no-sandbox, root, or Xvfb)

Also use headless by default everywhere so that npm test works out of the box for contributors if they use a secure development container where there's no graphical display or Xvfb running, and so that it is more likely to match CI behaviour. One can still override as before, by passing --browsers to the karma command (as such, I've kept the chrome-launcher depencency so that people preferring to debug there, can still easily do so).

XhmikosR commented 3 years ago

I don't know why it was chosen to run Firefox on Travis CI, so I just kept the previous behavior.

That being said, if chrome-launcher is unused, I'd remove it personally.