-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathkarma.conf.js
84 lines (78 loc) · 2.09 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
// Karma configuration
// Generated on Fri Nov 24 2017 23:08:45 GMT+0000 (GMT Standard Time)
'use strict';
const recursivePathToTests = 'test/**/*.ts';
const srcRecursivePath = '.tmp/drop/visual.js';
const srcCssRecursivePath = '.tmp/drop/visual.css';
const srcOriginalRecursivePath = 'src/**/*.ts';
const coverageFolder = 'coverage';
const coverage_reporters = [
{ type: 'text-summary' },
];
const reporters = [
'progress',
'coverage',
'karma-remap-istanbul',
];
module.exports = (config) => {
const browsers = [];
if (process.env.TRAVIS) {
console.log('On Travis sending coveralls');
browsers.push('ChromeTravisCI');
reporters.push('coveralls');
coverage_reporters.push({ type: 'lcov', dir: 'coverage' });
} else {
browsers.push('Chrome');
console.log('Not on Travis so not sending coveralls');
coverage_reporters.push({ type: 'html', dir: 'coverage', 'subdir': '.' });
}
config.set({
browsers,
customLaunchers: {
ChromeTravisCI: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
colors: true,
frameworks: ['jasmine'],
reporters: reporters,
singleRun: true,
files: [
srcCssRecursivePath,
srcRecursivePath,
'node_modules/lodash/lodash.min.js',
'node_modules/powerbi-visuals-utils-testutils/lib/index.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
recursivePathToTests,
{
pattern: srcOriginalRecursivePath,
included: false,
served: true
}
],
preprocessors: {
[recursivePathToTests]: ['typescript'],
[srcRecursivePath]: ['sourcemap', 'coverage']
},
typescriptPreprocessor: {
options: {
sourceMap: false,
target: 'ES5',
removeComments: false,
concatenateOutput: false
}
},
coverageReporter: {
reporters: coverage_reporters,
},
remapIstanbulReporter: {
reports: {
lcovonly: coverageFolder + '/lcov.info',
html: coverageFolder,
'text-summary': null
}
}
});
};