-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkarma.test.config.js
42 lines (38 loc) · 1.2 KB
/
karma.test.config.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
process.env.NODE_ENV = 'testing';
const path = require('path');
const webpack = require('webpack');
const webpackConfig = require('./webpack.config.js');
module.exports = function(config) {
webpackConfig.devtool = 'eval-source-map';
// lib/fetch is mocked, but lib/fetch.js is not mocked to allow access
// to the original module.
webpackConfig.plugins.push(new webpack.NormalModuleReplacementPlugin(
/lib\/fetch$/,
path.resolve(__dirname, 'src', 'mocks', 'fetch.js')
));
config.set({
basePath: '',
frameworks: ['jasmine'],
files: [
'src/test.js'
],
exclude: [
'src/**/*.swp'
],
preprocessors: {
'src/test.js': ['webpack', 'sourcemap']
},
webpack: webpackConfig,
// Mutiple reports can make it look like the tests are running twice
reporters: ['progress', 'json-result'],
jsonResultReporter: {
outputFile: ".karma-test-results.json",
isSynchronous: true
},
colors: true,
logLevel: config.LOG_ERROR,
autoWatch: true,
browsers: ['ChromeHeadless'],
concurrency: Infinity
})
}