forked from s-yadav/react-number-format
-
Notifications
You must be signed in to change notification settings - Fork 0
/
karma.conf.js
39 lines (37 loc) · 1.03 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
const webpack = require('webpack');
const { TEST_BROWSER } = process.env;
const runOnNode = TEST_BROWSER === 'ChromeHeadless';
module.exports = function (config) {
config.set({
browsers: [TEST_BROWSER || 'Chrome'],
singleRun: runOnNode,
frameworks: ['jasmine'],
files: ['./test/**/*.spec.js'],
reporters: [runOnNode ? 'spec' : 'kjhtml'],
preprocessors: {
'./test/**/*.js': ['webpack'], //preprocess with webpack
},
webpack: {
mode: runOnNode ? 'production' : 'development',
module: {
rules: [
{ test: /\.js$/, exclude: /node_modules/, use: ['babel-loader'] },
{ test: /\.ts|.tsx$/, exclude: /node_modules/, use: ['ts-loader'] },
],
},
externals: {},
resolve: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
watch: true,
plugins: [
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify('development'),
}),
],
},
webpackServer: {
noInfo: true,
},
});
};