forked from chaijs/type-detect
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.conf.js
More file actions
98 lines (96 loc) · 2.59 KB
/
Copy pathkarma.conf.js
File metadata and controls
98 lines (96 loc) · 2.59 KB
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
'use strict';
/* eslint-disable no-process-env */
var packageJson = require('./package.json');
var defaultTimeout = 120000;
var browserifyIstanbul = require('browserify-istanbul');
module.exports = function configureKarma(config) {
var localBrowsers = [
'PhantomJS',
];
var sauceLabsBrowsers = {
SauceChromeLatest: {
base: 'SauceLabs',
browserName: 'Chrome',
},
SauceFirefoxLatest: {
base: 'SauceLabs',
browserName: 'Firefox',
},
SauceSafariLatest: {
base: 'SauceLabs',
browserName: 'Safari',
platform: 'OS X 10.11',
},
SauceInternetExplorerLatest: {
base: 'SauceLabs',
browserName: 'Internet Explorer',
},
SauceInternetExplorerOldestSupported: {
base: 'SauceLabs',
browserName: 'Internet Explorer',
version: 9,
},
SauceEdgeLatest: {
base: 'SauceLabs',
browserName: 'MicrosoftEdge',
},
SauceAndroidLatest: {
base: 'SauceLabs',
browserName: 'Android',
},
};
config.set({
basePath: '',
browsers: localBrowsers,
logLevel: process.env.npm_config_debug ? config.LOG_DEBUG : config.LOG_INFO,
frameworks: [ 'browserify', 'mocha' ],
files: [ 'test/*.js' ],
exclude: [],
preprocessors: {
'test/*.js': [ 'browserify' ],
},
browserify: {
debug: true,
bare: true,
transform: [
browserifyIstanbul({ ignore: [ '**/node_modules/**', '**/test/**' ] }),
],
},
reporters: [ 'progress', 'coverage' ],
coverageReporter: {
type: 'lcov',
dir: 'coverage',
},
port: 9876,
colors: true,
concurrency: 3,
autoWatch: false,
captureTimeout: defaultTimeout,
browserDisconnectTimeout: defaultTimeout,
browserNoActivityTimeout: defaultTimeout,
singleRun: true,
});
if (process.env.SAUCE_ACCESS_KEY && process.env.SAUCE_USERNAME) {
var branch = process.env.TRAVIS_BRANCH || 'local';
var build = 'localbuild';
if (process.env.TRAVIS_JOB_NUMBER) {
build = 'travis@' + process.env.TRAVIS_JOB_NUMBER;
}
config.reporters.push('saucelabs');
config.set({
customLaunchers: sauceLabsBrowsers,
browsers: localBrowsers.concat(Object.keys(sauceLabsBrowsers)),
sauceLabs: {
testName: packageJson.name,
tunnelIdentifier: process.env.TRAVIS_JOB_NUMBER || new Date().getTime(),
recordVideo: true,
startConnect: ('TRAVIS' in process.env) === false,
tags: [
'typeDetect_' + packageJson.version,
process.env.SAUCE_USERNAME + '@' + branch,
build,
],
},
});
}
};