added updated dockerfiles and ric workflow
[it/otf.git] / otf-frontend / client / config / karma.conf.js
1 /*  Copyright (c) 2019 AT&T Intellectual Property.                             #\r
2 #                                                                              #\r
3 #   Licensed under the Apache License, Version 2.0 (the "License");            #\r
4 #   you may not use this file except in compliance with the License.           #\r
5 #   You may obtain a copy of the License at                                    #\r
6 #                                                                              #\r
7 #       http://www.apache.org/licenses/LICENSE-2.0                             #\r
8 #                                                                              #\r
9 #   Unless required by applicable law or agreed to in writing, software        #\r
10 #   distributed under the License is distributed on an "AS IS" BASIS,          #\r
11 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #\r
12 #   See the License for the specific language governing permissions and        #\r
13 #   limitations under the License.                                             #\r
14 ##############################################################################*/\r
15 \r
16 \r
17 // Karma configuration file, see link for more information\r
18 // https://karma-runner.github.io/1.0/config/configuration-file.html\r
19 \r
20 module.exports = function (config) {\r
21   const defaults = {\r
22     basePath: '',\r
23     frameworks: ['jasmine', '@angular-devkit/build-angular'],\r
24     plugins: [\r
25       require('karma-jasmine'),\r
26       require('karma-chrome-launcher'),\r
27       require('karma-jasmine-html-reporter'),\r
28       require('karma-coverage-istanbul-reporter'),\r
29       require('@angular-devkit/build-angular/plugins/karma')\r
30     ],\r
31     client:{\r
32       clearContext: false // leave Jasmine Spec Runner output visible in browser\r
33     },\r
34     coverageIstanbulReporter: {\r
35       dir: require('path').join(__dirname, 'coverage'), reports: [ 'html', 'lcovonly' ],\r
36       fixWebpackSourcePaths: true\r
37     },\r
38     angularCli: {\r
39       environment: 'dev'\r
40     },\r
41     reporters: ['progress', 'kjhtml'],\r
42     port: 9876,\r
43     colors: true,\r
44     logLevel: config.LOG_INFO,\r
45     autoWatch: true,\r
46     browsers: ['Chrome'],\r
47     singleRun: false,\r
48   }\r
49 \r
50   if (process.env.TEST_CI) {\r
51     Object.assign(defaults, {\r
52       autoWatch: false,\r
53       browsers: ['ChromeHeadlessNoSandbox'],\r
54       singleRun: true,\r
55       customLaunchers: {\r
56         ChromeHeadlessNoSandbox: {\r
57           base: 'ChromeHeadless',\r
58           flags: ['--no-sandbox']\r
59         }\r
60       },\r
61       browserNoActivityTimeout: 60000,\r
62     })\r
63   }\r
64 \r
65   config.set(defaults)\r
66 };\r