I am using angular-cli and I want to use two karma.conf.js files for testing.
For CI : For which I am using Headless Chrome
customLaunchers: {
ChromeHeadless: { base: 'Chrome', flags: [ '--headless', '--disable-gpu', // Without a remote debugging port, Google Chrome exits immediately. '--remote-debugging-port=9222', ], } }
For Dev : For which I am using Chrome.
Is there any way that I could switch betwwen two karma.conf.js based on an argument value.
You can use option karmaConfig
:
ng test --karmaConfig=another-karma.config.json
You may want to check ng test --help=true
for other options.
In the Angular CLI v6 the option name got changed: ng test --karma-config <your config here>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With