This repository has been archived by the owner on Aug 25, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
/
karma.conf.js
83 lines (78 loc) · 2.31 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
'use strict';
const recursivePathToTests = 'test/**/*.ts'
, srcRecursivePath = '.tmp/drop/visual.js'
, srcCssRecursivePath = '.tmp/drop/visual.css'
, srcOriginalRecursivePath = 'src/**/*.ts'
, coverageFolder = 'coverage';
module.exports = (config) => {
const browsers = [];
if (process.env.TRAVIS) {
browsers.push('ChromeTravisCI');
} else {
browsers.push('Chrome');
}
config.set({
client: {
accessToken: process.env.MAPBOX_TOKEN || "",
},
browsers,
customLaunchers: {
ChromeTravisCI: {
base: 'Chrome',
flags: ['--no-sandbox']
}
},
colors: true,
frameworks: ['jasmine'],
reporters: [
'progress',
'coverage',
'karma-remap-istanbul'
],
singleRun: true,
files: [
srcCssRecursivePath,
srcRecursivePath,
'node_modules/lodash/lodash.min.js',
'node_modules/powerbi-visuals-utils-testutils/lib/index.js',
'node_modules/powerbi-visuals-utils-typeutils/lib/index.js',
'node_modules/jquery/dist/jquery.min.js',
'node_modules/jasmine-jquery/lib/jasmine-jquery.js',
'test/visualData.ts',
'test/visualBuilder.ts',
recursivePathToTests,
{
pattern: srcOriginalRecursivePath,
included: false,
served: true
}
],
preprocessors: {
[recursivePathToTests]: ['typescript', 'sourcemap'],
[srcRecursivePath]: ['sourcemap', 'coverage']
},
typescriptPreprocessor: {
options: {
sourceMap: true,
inlineSourceMap: true,
target: 'ES5',
removeComments: false,
concatenateOutput: false
}
},
coverageReporter: {
dir: coverageFolder,
reporters: [
{ type: 'html' },
{ type: 'lcov' }
]
},
remapIstanbulReporter: {
reports: {
lcovonly: coverageFolder + '/lcov.info',
html: coverageFolder,
'text-summary': null
}
}
});
};