forked from mobstac-private/tqrcg-barcode.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
81 lines (70 loc) · 1.98 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
module.exports = function(karma) {
var sauceLaunchers = {
sl_chrome: {
base: 'SauceLabs',
browserName: 'chrome',
platform: 'Linux',
},
sl_firefox: {
base: 'SauceLabs',
browserName: 'firefox',
platform: 'Linux',
},
// Chrome on travis is too old
// travis_chrome: {
// base: 'Chrome',
// flags: ['--no-sandbox']
// }
};
var cfg = {
basePath: '.',
frameworks: ['mocha', 'requirejs'],
preprocessors: {
'**/*.js': ['sourcemap']
},
client: {
mocha: {
timeout : 6000
}
},
files: [
'node_modules/iconv.js/iconv.js',
{pattern: 'node_modules/chai/chai.js', included: false},
{pattern: 'node_modules/chai-as-promised/lib/*.js', included: false},
{pattern: 'node_modules/sinon/pkg/sinon.js', included: false},
{pattern: 'src/**/*.js', included: false},
{pattern: 'test_data/**/*.*', included: false, served: true, watched: true},
// {pattern: 'tests/**/*.js', included: false, served: true, watched: true},
{pattern: 'tests/blackbox.data.js', included: false},
{pattern: 'tests/**/*.js', included: false},
'dist/w69b.qrcode.js',
{pattern: 'dist/w69b.qrcode.decodeworker.*', included: false},
'tests/main-test.js'
],
// list of files to exclude
exclude: [],
reporters: ['progress'],
port: 8080,
runnerPort: 9100,
colors: true,
autoWatch: true,
sauceLabs: {
testName: 'barcode.js Tests',
startConnect: false,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER
},
customLaunchers: sauceLaunchers,
browsers: ['Chrome', 'Firefox'],
singleRun: false,
browserNoActivityTimeout: 300000
};
if (process.env.TRAVIS) {
cfg.reporters = ['dots'];
// sauce has WebGl, travis not
if (process.env.TRAVIS_PULL_REQUEST == 'false')
cfg.browsers = Object.keys(sauceLaunchers);
else
cfg.browsers = ['Firefox'];
}
karma.set(cfg);
};