-
Notifications
You must be signed in to change notification settings - Fork 213
/
karma.conf.js
72 lines (64 loc) · 1.88 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
('use strict');
process.env.CHROME_BIN = require('puppeteer').executablePath();
module.exports = function(karma) {
karma.set({
// frameworks to use
frameworks: ['jasmine', 'sinon'],
// list of files / patterns to load in the browser
files: [
'https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.min.js',
`https://unpkg.com/three@latest/build/three.min.js`,
// ,
// 'specs/core/*.spec.*s',
'specs/**/*.spec.*s',
{ pattern: 'data/**/*', included: false, watched: false, served: true },
],
reporters: ['spec'],
// preprocess matching files before serving them to the browser
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
preprocessors: {
'specs/**/*.spec.*s': ['webpack'],
},
browsers: ['ChromeHeadless'],
// You have to add the mime type for Typescript files. Otherwise, Chrome won't run these files.
mime: {
'text/x-typescript': ['ts']
},
// web server port
// port: 9876,
// colors: true,
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: karma.LOG_WARN,
autoWatch: false,
singleRun: true,
colors: true,
webpack: {
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.css', '.html', '.scss', '.json'],
},
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: [/node_modules/, /external/],
},
{
test: /\.ts$/,
loader: 'ts-loader',
exclude: [/external/],
},
],
},
mode: 'development',
node: {
fs: 'empty',
},
},
webpackMiddleware: {
// webpack-dev-middleware configuration
// i. e.
stats: 'errors-only',
},
});
};