-
Notifications
You must be signed in to change notification settings - Fork 72
/
karma.conf.js
41 lines (39 loc) · 1.27 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
const fileName = process.env.WHITELIST ? 'whitelist' : 'blacklist'
const customContextFile = `test/index-${fileName}.html`
console.log('karma context:', customContextFile)
module.exports = function(config) {
config.set({
files: ['test/**/*.js'],
frameworks: ['mocha', 'chai'],
plugins: [
require('karma-mocha'),
require('karma-chai'),
require('karma-chrome-launcher'),
require('karma-firefox-launcher'),
require('karma-safari-launcher'),
],
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
browsers: ['ChromeHeadless', 'FirefoxHeadless', 'Safari'],
autoWatch: false,
concurrency: 1,
customLaunchers: {
FirefoxHeadless: {
base: 'Firefox',
flags: [ '-headless' ],
}
},
files: [
{ pattern: 'test/scripts/yett.min.js', included: false },
{ pattern: 'test/scripts/not-blocked.js', included: false },
{ pattern: 'test/scripts/script.js', included: false },
{ pattern: 'test/scripts/script-blocked.js', included: false },
{ pattern: 'test/scripts/dynamic.js', included: false },
'test/test.js'
],
customContextFile,
clearContext: false,
})
}