Update README.md
[inboxen.git] / karma.conf.js
blob5de36bed0868a0e501563da8827cf6db13eedb2d
1 function browserNormaliser(browser) {
2     return browser.toLowerCase().split(/[ /-]/)[0];
5 module.exports = function(config) {
6     var chromeOpts = {
7         base: "Chromium"
8     };
10     if (process.env.CI) {
11         chromeOpts = {
12             base: "ChromiumHeadless",
13             flags: ["--no-sandbox"]
14         };
15     }
17     var reporters = ['progress', 'kjhtml'];
18     if (!process.env.SKIP_COVERAGE) {
19         reporters.push("coverage");
20     }
22     config.set({
23         logLevel: config.LOG_INFO,
24         frameworks: ['jasmine'],
25         customLaunchers: {
26             ChromiumMaybeHeadless: chromeOpts
27         },
28         reporters: reporters,
29         coverageReporter: {
30             reporters: [
31                 {
32                     type: 'lcov',
33                     dir: 'coverage/',
34                     subdir: '.'
35                 },
36                 {type: "text-summary"},
37                 {
38                     type: "html",
39                     dir: "htmlcov",
40                     subdir: browserNormaliser
41                 }
42             ]
43         }
44     });