Skip to content

Commit ac7e4ca

Browse files
committed
test: configure karma browsers
1 parent 1351352 commit ac7e4ca

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

karma.conf.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22
// https://karma-runner.github.io/1.0/config/configuration-file.html
33

44
module.exports = function (config) {
5+
const browsers = [];
6+
if (process.env.CHROME_BIN) {
7+
browsers.push('ChromeHeadless');
8+
} else if (process.env.CHROMIUM_BIN) {
9+
browsers.push('ChromiumHeadless');
10+
}
11+
if (browsers.length === 0) {
12+
if (process.platform === 'win32') {
13+
browsers.push('EdgeHeadless');
14+
} else {
15+
browsers.push('ChromiumHeadless');
16+
}
17+
}
18+
519
config.set({
620
basePath: '',
721
frameworks: ['jasmine', '@angular-devkit/build-angular'],
@@ -19,7 +33,8 @@ module.exports = function (config) {
1933
// for example, you can disable the random execution with `random: false`
2034
// or set a specific seed with `seed: 4321`
2135
},
22-
clearContext: false // leave Jasmine Spec Runner output visible in browser
36+
clearContext: false, // leave Jasmine Spec Runner output visible in browser
37+
sourceMapSupport: true
2338
},
2439
jasmineHtmlReporter: {
2540
suppressAll: true // removes the duplicated traces
@@ -35,7 +50,7 @@ module.exports = function (config) {
3550
logLevel: config.LOG_INFO,
3651
browserConsoleLogOptions: { level: 'info' },
3752
autoWatch: true,
38-
browsers: ['ChromeHeadless'],
53+
browsers: browsers,
3954
singleRun: true,
4055
restartOnFileChange: true
4156
});

0 commit comments

Comments
 (0)