Angular 15 comes with fewer configuration files than the previous versions, incl. karma.conf.js
having been dropped. For running ng test --browsers=FirefoxHeadless
under Angular 14, I used to configure karma.conf.js
to require('karma-firefox-launcher')
plugin.
How should this be done in Angular 15?
karma.conf.js
from the previous Angular 14 project and add set "architect.test.options.karmaConfig"
in angular.json
to that karma.conf.js
file?angular.json
directly, and would that be better?karma.conf.js
?(motivation: my build server executes ng test
in a headless container, so for the sake of a simple build container configuration, I prefer FirefoxHeadless
over the test runner's default browser)
In Angular 15 you can generate the missing config by doing ng generate config karma
then modify it to your needs. This also automatically updates the angular.json
config file for you.