forked from ng-lightning/ng-lightning
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.conf.js
110 lines (89 loc) · 4.04 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
const isTravis = process.env.TRAVIS;
const isSaucelabs = process.argv.indexOf('--saucelabs') !== -1 || (isTravis && process.env.TRAVIS_PULL_REQUEST === 'false');
if (isSaucelabs && !process.env.SAUCE_USERNAME) {
try {
const credentials = require('./saucelabs.json');
process.env.SAUCE_USERNAME = credentials.username;
process.env.SAUCE_ACCESS_KEY = credentials.accessKey;
} catch (err) {
console.log('Please, create a valid "saucelabs.json" with your credentials.');
process.exit(1);
}
}
module.exports = function(config) {
const cfg = {
basePath: '',
frameworks: ['jasmine'],
files: [
// Polyfills
{pattern: 'node_modules/es6-shim/es6-shim.js', included: true, watched: false},
{pattern: 'node_modules/reflect-metadata/Reflect.js', included: true, watched: false},
// Intl pollyfill
'https://cdn.polyfill.io/v2/polyfill.min.js?features=Intl.~locale.en',
// Typescript helpers polyfill
{pattern: 'node_modules/ts-helpers/index.js', included: true, watched: false},
// System.js for module loading
{pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: true, watched: false},
{pattern: 'node_modules/systemjs/dist/system.src.js', included: true, watched: false},
// Zone.js
{pattern: 'node_modules/zone.js/dist/zone.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/jasmine-patch.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/async-test.js', included: true, watched: false},
{pattern: 'node_modules/zone.js/dist/fake-async-test.js', included: true, watched: false},
// RxJS
{pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false},
{pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false},
// Angular
{pattern: 'node_modules/@angular/**/*.js', included: false, watched: false},
{pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: false},
// Other libraries
{pattern: 'node_modules/tether/dist/js/tether.min.js', included: true, watched: false},
{pattern: 'karma-shim.js', included: true, watched: true},
// Our built application code
{pattern: 'temp/**/*.js', included: false, watched: true},
// paths to support debugging with source maps in dev tools
{pattern: 'src/**/*.ts', included: false, watched: false},
{pattern: 'temp/**/*.js.map', included: false, watched: false},
// fixtures
{pattern: 'test/fixtures/**', watched: false, included: false, served: true},
],
proxies: {
// Avoid 404 warnings for images during testing
'/assets/icons/utility-sprite/svg/symbols.svg': '/base/test/fixtures/fake',
'/mypath/utility-sprite/svg/symbols.svg': '/base/test/fixtures/fake',
'/mypath/standard-sprite/svg/symbols.svg': '/base/test/fixtures/fake',
'/mypath/custom-sprite/svg/symbols.svg': '/base/test/fixtures/fake',
'/image1.jpg': '/base/test/fixtures/fake',
'/tether': '/base/node_modules/tether/dist/js/tether.min.js'
},
preprocessors: {
'temp/**/*.js': ['sourcemap'],
'temp/src/**/!(*spec|*mock).js': ['coverage'],
},
coverageReporter: {
dir: 'coverage/',
reporters: [{type: 'text-summary'}, {type: 'html'}],
},
reporters: isTravis ? ['dots'] : ['progress', 'coverage'],
port: isTravis ? 9876 : 23011,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: [isTravis ? 'Firefox' : 'Chrome'],
singleRun: false,
};
if (isSaucelabs) {
cfg.customLaunchers = require('./test/browser-providers');
cfg.browsers = Object.keys(cfg.customLaunchers);
cfg.reporters.push('saucelabs');
cfg.sauceLabs = {
tunnelIdentifier: isTravis ? process.env.TRAVIS_JOB_NUMBER : 'ng-lightning',
connectOptions: {
logfile: './saucelabs.log',
},
};
cfg.captureTimeout = 120000;
cfg.browserNoActivityTimeout = 120000;
}
config.set(cfg);
};