forked from w3c/trusted-types
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
117 lines (100 loc) · 2.85 KB
/
karma.conf.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/* eslint-disable */
/**
* @license
* Copyright 2017 Google Inc. All Rights Reserved.
*
* Licensed under the W3C SOFTWARE AND DOCUMENT NOTICE AND LICENSE.
*
* https://www.w3.org/Consortium/Legal/2015/copyright-software-and-document
*/
var browsers = ['ChromeHeadlessNoSandbox', 'FirefoxHeadlessDev'];
// Don't use BrowserStack browsers when running on Travis from a pull request.
// https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
if (process.env.BROWSERSTACK_ACCESS_KEY) {
browsers.push('ChromeBrowserStack');
browsers.push('EdgeBrowserStack');
browsers.push('SafariBrowserStack');
browsers.push('InternetExplorer11BrowserStack');
} else {
console.log('Skipping BrowserStack tests due to missing BROWSERSTACK_ACCESS_KEY environment variable.');
}
module.exports = function(config) {
config.set({
basePath: '',
frameworks: ['browserify', 'jasmine'],
files: [
{ pattern: 'tests/**/*_test.js'},
],
exclude: [
'**/*.swp'
],
preprocessors: {
'tests/**/*.js': ['browserify'],
},
// global config of your BrowserStack account
browserStack: {
username: 'afasfas1',
project: 'trusted-types-polyfill',
},
browserify : {
configure: function browserify(bundle) {
bundle.once('prebundle', function prebundle() {
bundle.transform('babelify', {
presets: ['@babel/preset-env'],
sourceMapsAbsolute: true,
});
});
},
debug: true,
},
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: browsers,
customLaunchers: {
ChromeBrowserStack: {
base: 'BrowserStack',
browser: 'chrome',
os: 'windows',
os_version: '10',
},
EdgeBrowserStack: {
base: 'BrowserStack',
browser: 'edge',
os: 'windows',
os_version: '10',
},
InternetExplorer11BrowserStack: {
base: 'BrowserStack',
browser: 'ie',
vesion: '11',
os: 'windows',
os_version: '10',
},
SafariBrowserStack: {
base: 'BrowserStack',
browser: 'safari',
browser_version: '12',
os: 'osx',
os_version: 'Mojave',
},
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox', '--remote-debugging-port=9222'],
debug: true,
},
FirefoxHeadlessDev: {
base: 'FirefoxHeadless',
prefs: {
// Not enabled in release versions.
// https://developer.mozilla.org/en-US/Firefox/Experimental_features
'security.csp.enable_violation_events': true,
}
}
},
singleRun: false,
concurrency: Infinity
})
}