|
1 | | -// Karma configuration |
2 | | -// Generated on Wed May 24 2017 14:10:20 GMT-0700 (PDT) |
| 1 | +/** |
| 2 | + * Copyright 2018, Optimizely |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | + |
| 17 | +// Karma configuration for cross-browser testing |
| 18 | +const baseConfig = require('./karma.base.conf.js') |
3 | 19 |
|
4 | 20 | module.exports = function(config) { |
5 | 21 | config.set({ |
| 22 | + ...baseConfig, |
6 | 23 |
|
7 | | - // base path that will be used to resolve all patterns (eg. files, exclude) |
8 | | - basePath: '', |
9 | | - |
10 | | - //plugins |
11 | | - plugins: ['karma-mocha', 'karma-webpack', require('karma-browserstack-launcher')], |
12 | | - |
13 | | - webpack: { |
14 | | - mode: 'production', |
15 | | - }, |
16 | | - |
17 | | - //browserStack setup |
18 | | - browserStack: { |
19 | | - username: process.env.BROWSER_STACK_USERNAME, |
20 | | - accessKey: process.env.BROWSER_STACK_ACCESS_KEY |
21 | | - }, |
22 | | - |
23 | | - // to avoid DISCONNECTED messages when connecting to BrowserStack |
24 | | - browserDisconnectTimeout: 10000, // default 2000 |
25 | | - browserDisconnectTolerance: 1, // default 0 |
26 | | - browserNoActivityTimeout: 4 * 60 * 1000, //default 10000 |
27 | | - captureTimeout: 4 * 60 * 1000, //default 60000 |
28 | | - |
29 | | - // define browsers |
30 | | - customLaunchers: { |
31 | | - bs_chrome_mac: { |
32 | | - base: 'BrowserStack', |
33 | | - browser: 'chrome', |
34 | | - browser_version: '21.0', |
35 | | - os: 'OS X', |
36 | | - os_version: 'Mountain Lion' |
37 | | - }, |
38 | | - bs_edge: { |
39 | | - base: 'BrowserStack', |
40 | | - os: 'Windows', |
41 | | - os_version: '10', |
42 | | - browser: 'edge', |
43 | | - device: null, |
44 | | - browser_version: '15.0' |
45 | | - }, |
46 | | - bs_firefox_mac: { |
47 | | - base: 'BrowserStack', |
48 | | - browser: 'firefox', |
49 | | - browser_version: '21.0', |
50 | | - os: 'OS X', |
51 | | - os_version: 'Mountain Lion' |
52 | | - }, |
53 | | - bs_ie: { |
54 | | - base: 'BrowserStack', |
55 | | - os: 'Windows', |
56 | | - os_version: '7', |
57 | | - browser: 'ie', |
58 | | - device: null, |
59 | | - browser_version: '10.0' |
60 | | - }, |
61 | | - bs_iphone6: { |
62 | | - base: 'BrowserStack', |
63 | | - device: 'iPhone 6', |
64 | | - os: 'ios', |
65 | | - os_version: '8.3' |
66 | | - }, |
67 | | - bs_opera_mac: { |
68 | | - base: 'BrowserStack', |
69 | | - browser: 'opera', |
70 | | - browser_version: '37', |
71 | | - os: 'OS X', |
72 | | - os_version: 'Mountain Lion' |
73 | | - }, |
74 | | - bs_safari: { |
75 | | - base: 'BrowserStack', |
76 | | - os: 'OS X', |
77 | | - os_version: 'Mountain Lion', |
78 | | - browser: 'safari', |
79 | | - device: null, |
80 | | - browser_version: '6.2' |
81 | | - } |
82 | | - }, |
83 | | - |
84 | | - browsers: ['bs_chrome_mac', 'bs_edge', 'bs_firefox_mac', 'bs_ie', 'bs_iphone6', 'bs_opera_mac', 'bs_safari'], |
85 | | - |
86 | | - // frameworks to use |
87 | | - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter |
88 | | - frameworks: ['mocha'], |
89 | | - |
| 24 | + // level of logging |
| 25 | + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
| 26 | + logLevel: config.LOG_INFO, |
90 | 27 |
|
91 | 28 | // list of files / patterns to load in the browser |
92 | 29 | files: [ |
93 | 30 | './lib/index.browser.tests.js' |
94 | 31 | ], |
95 | | - |
96 | | - |
97 | | - // list of files to exclude |
98 | | - exclude: [ |
99 | | - ], |
100 | | - |
101 | | - |
102 | | - // preprocess matching files before serving them to the browser |
103 | | - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor |
104 | | - preprocessors: { |
105 | | - './lib/**/*tests.js': ['webpack'] |
106 | | - }, |
107 | | - |
108 | | - |
109 | | - // test results reporter to use |
110 | | - // possible values: 'dots', 'progress' |
111 | | - // available reporters: https://npmjs.org/browse/keyword/karma-reporter |
112 | | - reporters: ['progress'], |
113 | | - |
114 | | - |
115 | | - // web server port |
116 | | - port: 9876, |
117 | | - |
118 | | - |
119 | | - // enable / disable colors in the output (reporters and logs) |
120 | | - colors: true, |
121 | | - |
122 | | - |
123 | | - // level of logging |
124 | | - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG |
125 | | - logLevel: config.LOG_INFO, |
126 | | - |
127 | | - |
128 | | - // enable / disable watching file and executing tests whenever any file changes |
129 | | - autoWatch: false, |
130 | | - |
131 | | - // Continuous Integration mode |
132 | | - // if true, Karma captures browsers, runs the tests and exits |
133 | | - singleRun: true, |
134 | | - |
135 | | - // Concurrency level |
136 | | - // how many browser should be started simultaneous |
137 | | - concurrency: Infinity |
138 | 32 | }); |
139 | 33 | }; |
0 commit comments