f60dd93660
It does something, but things I don't like: * it churns for 15 seconds webpacking everything. Do we really need to get webpack involved here? * I don't think there's any way to control which tests get run and which don't. Other things I'd want to fix up include: * Make it run on jsdom or phantomjs instead of Chrome * figure out how to configure babel without a .babelrc
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
// karma.conf.js
|
|
var webpack = require('webpack');
|
|
var path = require('path');
|
|
|
|
module.exports = function (config) {
|
|
config.set({
|
|
browsers: ['Chrome'],
|
|
singleRun: true,
|
|
frameworks: ['mocha'],
|
|
files: [
|
|
'tests/tests.js'
|
|
],
|
|
preprocessors: {
|
|
'tests/tests.js': ['webpack', 'sourcemap']
|
|
},
|
|
reporters: ['dots'],
|
|
webpack: {
|
|
module: {
|
|
loaders: [
|
|
{ test: /\.json$/, loader: "json" },
|
|
{ test: /\.js$/, loader: "babel", include: path.resolve('./src') },
|
|
],
|
|
noParse: [
|
|
// don't parse the languages within highlight.js. They
|
|
// cause stack overflows
|
|
// (https://github.com/webpack/webpack/issues/1721), and
|
|
// there is no need for webpack to parse them - they can
|
|
// just be included as-is.
|
|
/highlight\.js\/lib\/languages/,
|
|
],
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'matrix-react-sdk': path.resolve('src/index.js'),
|
|
},
|
|
},
|
|
},
|
|
});
|
|
};
|