-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkarma.travis.conf.js
More file actions
74 lines (67 loc) · 2.06 KB
/
Copy pathkarma.travis.conf.js
File metadata and controls
74 lines (67 loc) · 2.06 KB
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
'use strict';
const path = require('path');
const plugins = require('./build/rollup.plugins');
const rollupPluginIstanbul = require('rollup-plugin-istanbul');
const baseConfig = require('./karma.base.conf');
const pkg = require('./package.json');
module.exports = function (config) {
const coverageIstanbulReporter = {
reports: ['lcov', 'text-summary', 'cobertura'],
dir: path.join(process.cwd(), 'coverage'),
skipFilesWithNoCoverage: true
};
const rollupPlugins = [
plugins.nodeResolve(),
plugins.commonjs({
include: 'node_modules/**',
ignore: ['js-base64'],
sourceMap: false,
namedExports: {
chai: ['expect']
}
}),
plugins.typescript({
tsconfig: 'test/tsconfig.json'
}),
rollupPluginIstanbul({
exclude: ['test/**/*.ts', "node_modules/**/*"],
instrumenterConfig: {
embedSource: true,
debug: true
}
})
];
config.set(Object.assign({}, baseConfig, {
preprocessors: {
'test/specs/**/*.spec.ts': ['rollup']
},
rollupPreprocessor: {
context: 'this',
watch: false,
output: {
format: 'iife',
name: pkg.library,
sourcemap: false
},
plugins: rollupPlugins,
onwarn: function(warning) {
if (warning.code === 'CIRCULAR_DEPENDENCY') {
return;
}
console.warn(`(!) ${warning.message}`);
}
},
reporters: ['mocha', 'coverage-istanbul'],
coverageIstanbulReporter: coverageIstanbulReporter,
logLevel: config.LOG_DEBUG,
plugins: [
'karma-chrome-launcher',
'karma-mocha',
'karma-chai',
'karma-mocha-reporter',
'karma-rollup-preprocessor',
'karma-coverage-istanbul-reporter'
],
singleRun: true
}));
};