-
Notifications
You must be signed in to change notification settings - Fork 1
/
karma.conf.js
79 lines (71 loc) · 1.72 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
/* eslint-disable no-var, strict */
'use strict';
process.env.NODE_ENV = 'development';
const webpackConfig = require('./webpack.config.js')('dev'); //prod was working as well
const merge = require('webpack-merge');
const webpack = require('webpack');
/**
* We're overriding any loaders to achieve:
* - removed css/less/sass style imports
* - pure tsx compilation
*/
const webpackConfigModule = {
rules: [
{
test: /\.tsx?$/,
use: [
{ loader: 'ts-loader',
options: {
happyPackMode: true,
transpileOnly: false
}
}
],
exclude: [/node_modules/],
},
{ test: /\.(css|less|scss)$/, loader: 'ignore-loader' },
{
test: /\.html$/,
loader: 'raw-loader',
exclude: /node_modules/
}
]
};
module.exports = function(config) {
// Documentation: https://karma-runner.github.io/0.13/config/configuration-file.html
config.set({
basePath: '',
frameworks: [ 'jasmine'],
browsers: [ 'Chrome', 'PhantomJS' ],
files: [
// This ensures we have the es6 shims in place and then loads all the tests
'test/main.js'
],
port: 9876,
logLevel: config.LOG_INFO, //config.LOG_DEBUG
preprocessors: {
'test/main.js': [ 'webpack', 'sourcemap' ]
},
webpack: {
mode: 'development',
devtool: 'inline-source-map',
module: webpackConfigModule,
resolve: webpackConfig.resolve
},
webpackMiddleware: {
quiet: true,
stats: {
colors: true
}
},
// reporter options
mochaReporter: {
colors: {
success: 'bgGreen',
info: 'cyan',
warning: 'bgBlue',
error: 'bgRed'
}
}
});
};