2014-11-25 02:44:50 +00:00
|
|
|
var _ = require('lodash'),
|
|
|
|
config = require('./config');
|
|
|
|
|
|
|
|
module.exports = function(karma) {
|
2014-12-05 00:11:30 +00:00
|
|
|
var globs = _.flatten([
|
|
|
|
config.globs.js,
|
|
|
|
config.globs.spec
|
2016-01-03 16:53:10 +00:00
|
|
|
]),
|
|
|
|
browser = 'Chrome';
|
|
|
|
|
|
|
|
if (process.env.TRAVIS) {
|
|
|
|
globs.unshift('node_modules/babel-polyfill/dist/polyfill.js');
|
|
|
|
browser = 'PhantomJS';
|
|
|
|
}
|
2014-11-25 02:44:50 +00:00
|
|
|
|
|
|
|
karma.set({
|
|
|
|
frameworks: ['browserify', 'jasmine'],
|
|
|
|
files: globs,
|
|
|
|
preprocessors: _(globs)
|
|
|
|
.zipObject()
|
|
|
|
.mapValues(_.constant(['browserify']))
|
|
|
|
.valueOf(),
|
|
|
|
reporters: ['progress', 'notify'],
|
|
|
|
colors: true,
|
|
|
|
logLevel: karma.LOG_INFO,
|
2016-01-03 16:53:10 +00:00
|
|
|
browsers: [browser],
|
2014-11-25 02:44:50 +00:00
|
|
|
autoWatch: true,
|
|
|
|
singleRun: false,
|
2015-10-31 16:09:38 +00:00
|
|
|
browserify: _.extend({
|
2015-11-01 11:50:57 +00:00
|
|
|
configure: function(bundler) {
|
|
|
|
bundler.transform(require('./lib/canopy-transform'));
|
|
|
|
bundler.transform(require('babelify'));
|
2015-10-31 16:09:38 +00:00
|
|
|
}
|
|
|
|
}, config.browserify)
|
2014-11-25 02:44:50 +00:00
|
|
|
});
|
|
|
|
};
|