-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
52 lines (47 loc) · 1.41 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
"use strict";
const path = require('path');
const project = require('./aurelia_project/aurelia.json');
const testSrc = [
{ pattern: project.unitTestRunner.source, included: false },
'test/aurelia-karma.js'
];
const output = project.platform.output;
const appSrc = project.build.bundles.map(x => path.join(output, x.name));
const entryIndex = appSrc.indexOf(path.join(output, project.build.loader.configTarget));
const entryBundle = appSrc.splice(entryIndex, 1)[0];
const files = [entryBundle].concat(testSrc).concat(appSrc);
module.exports = function (config) {
const cfg = {
basePath: '',
frameworks: [project.testFramework.id],
files,
exclude: [],
preprocessors: {
[project.unitTestRunner.source]: [project.transpiler.id]
},
babelPreprocessor: { options: project.transpiler.options },
reporters: ['progress'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
customLaunchers: {
Chrome_travis_ci: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
singleRun: false,
// client.args must be a array of string.
// Leave 'aurelia-root', project.paths.root in this order so we can find
// the root of the aurelia project.
client: {
args: ['aurelia-root', project.paths.root]
}
};
if (process.env.TRAVIS) {
cfg.browsers = ['Chrome_travis_ci'];
}
config.set(cfg);
};