-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkarma.conf.js
70 lines (57 loc) · 1.38 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
module.exports = (config) => {
const packageJson = require('./package.json');
const path = require('path');
let files = [
require.resolve('jquery'),
path.join(path.dirname(require.resolve('d3')), 'd3.js')
];
if(packageJson.dependencies.jquery !== undefined) {
files.push({
pattern: require.resolve('jasmine-jquery'),
watched: false,
served: true
});
}
if(process.env.TEST_MIN_BUNDLE) {
files.push(path.join(__dirname, 'dist/js/graph-editor.min.js'));
}
else if(process.env.TEST_BUNDLE) {
files.push(path.join(__dirname, './dist/js/graph-editor.js'));
}
else {
files.push.apply(files, [
path.join(__dirname, 'tests/test-start.js'),
path.join(__dirname, 'src/main.js'),
path.join(__dirname, 'src/js/**/*.js')
]);
}
files.push(path.join(__dirname, 'tests/**/*.test.js'));
let browsers = process.env.TEST_BROWSERS;
if(browsers) {
browsers = browsers.split(/\s+/);
}
if(!(browsers && browsers[0])) {
browsers = ['Chromium'];
}
config.set({
basePath: '../',
files: files,
frameworks: ['jasmine'],
reporters: ['spec'],
specReporter: {
maxLogLines: 5,
suppressErrorSummary: true,
suppressFailed: false,
suppressPassed: false,
suppressSkipped: true,
showSpecTiming: false,
failFast: false
},
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
singleRun: false,
browsers: browsers
});
};