forked from interledgerjs/five-bells-condition
-
Notifications
You must be signed in to change notification settings - Fork 5
/
karma.conf.js
61 lines (58 loc) · 1.49 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
const puppeteer = require('puppeteer')
const { ProvidePlugin } = require('webpack')
process.env.CHROME_BIN = puppeteer.executablePath()
module.exports = function (karma) {
karma.set({
frameworks: ['mocha', 'webpack'],
plugins: [
'karma-webpack',
'karma-mocha',
'karma-sourcemap-loader',
'karma-chrome-launcher'
],
files: [{ pattern: 'test/*Spec.js', watched: false }],
preprocessors: {
'test/*Spec.js': ['webpack', 'sourcemap']
},
webpack: {
devtool: 'inline-source-map',
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules|dist/,
loader: 'babel-loader'
}
],
noParse: [/sinon/]
},
resolve: {
alias: { sinon: 'sinon/pkg/sinon' },
fallback: {
buffer: require.resolve('buffer/'),
crypto: require.resolve('crypto-browserify'),
fs: false,
path: require.resolve('path-browserify'),
process: require.resolve('process/browser'),
querystring: require.resolve('querystring-es3'),
stream: require.resolve('stream-browserify')
}
},
plugins: [
new ProvidePlugin({
Buffer: ['buffer', 'Buffer']
}),
new ProvidePlugin({
process: 'process/browser'
})
],
node: {
global: true
}
},
webpackMiddleware: {
stats: 'errors-only'
},
browsers: ['ChromeHeadless']
})
}