forked from canadianpress/superdesk-client-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
80 lines (63 loc) · 1.94 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
var path = require('path');
var grunt = require('grunt');
var makeConfig = require('./webpack.config.js');
module.exports = function(config) {
var webpackConfig = makeConfig(grunt);
// in karma, entry is read from files prop
webpackConfig.entry = null;
webpackConfig.devtool = 'eval';
config.set({
frameworks: [
'jasmine',
],
plugins: [
'karma-jasmine',
'karma-chrome-launcher',
'karma-ng-html2js-preprocessor',
'karma-sourcemap-loader',
'karma-webpack',
],
preprocessors: {
'**/*.html': ['ng-html2js'],
'scripts/tests.ts': ['webpack', 'sourcemap'],
},
webpack: webpackConfig,
webpackMiddleware: {
chunks: false,
modules: false,
stats: false,
debug: false,
progress: false,
// quiet: true
watchOptions: {
ignored: path.join(__dirname, 'scripts', 'extensions'),
},
},
files: [
'scripts/tests.ts',
'scripts/**/*.html',
],
ngHtml2JsPreprocessor: {
stripPrefix: __dirname,
moduleName: 'superdesk.templates-cache',
},
// test results reporter to use
reporters: ['dots'],
// web server port
port: 8080,
// cli runner port
runnerPort: 9100,
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
browsers: ['ChromeHeadless'],
// Continuous Integration mode
singleRun: false,
// Seams default 10s is not enough for CI sometime, so let's try 30s
browserNoActivityTimeout: 30000,
// Allow typescript files
mime: {
'text/x-typescript': ['ts', 'tsx'],
},
});
};