influxdb/ui/karma.conf.js

67 lines
2.0 KiB
JavaScript
Raw Normal View History

2018-02-20 03:26:17 +00:00
const webpack = require('webpack')
const path = require('path')
2016-09-16 22:32:07 +00:00
module.exports = function(config) {
config.set({
browsers: ['PhantomJS'],
2018-02-26 20:48:18 +00:00
frameworks: ['mocha'],
2016-09-16 22:32:07 +00:00
files: [
'node_modules/babel-polyfill/dist/polyfill.js',
'spec/spec-helper.js',
'spec/index.js',
],
preprocessors: {
'spec/spec-helper.js': ['webpack', 'sourcemap'],
'spec/index.js': ['webpack', 'sourcemap'],
},
// For more detailed reporting on tests, you can add 'verbose' and/or 'progress'.
// This can also be done via the command line with `yarn test -- --reporters=verbose`.
reporters: ['dots'],
2016-09-16 22:32:07 +00:00
webpack: {
devtool: 'inline-source-map',
module: {
loaders: [
{
test: /\.js$/,
exclude: /node_modules/,
loader: 'babel-loader',
},
{
test: /\.css/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!postcss-loader',
},
{
test: /\.scss/,
exclude: /node_modules/,
loader: 'style-loader!css-loader!sass-loader',
},
{
// Sinon behaves weirdly with webpack, see https://github.com/webpack/webpack/issues/304
2016-09-16 22:32:07 +00:00
test: /sinon\/pkg\/sinon\.js/,
loader: 'imports?define=>false,require=>false',
},
],
},
externals: {
'react/addons': true,
'react/lib/ExecutionEnvironment': true,
'react/lib/ReactContext': true,
2016-09-16 22:32:07 +00:00
},
resolve: {
alias: {
app: path.resolve(__dirname, 'app'),
src: path.resolve(__dirname, 'src'),
chronograf: path.resolve(__dirname, 'src', 'chronograf'),
shared: path.resolve(__dirname, 'src', 'shared'),
style: path.resolve(__dirname, 'src', 'style'),
utils: path.resolve(__dirname, 'src', 'utils'),
},
},
},
webpackServer: {
noInfo: true, // please don't spam the console when running in karma!
},
})
}