Skip to content

Instantly share code, notes, and snippets.

@naganowl
Created September 23, 2016 19:05
Show Gist options
  • Save naganowl/e3e8ff73b7b6d371bb942acd588cc792 to your computer and use it in GitHub Desktop.
Save naganowl/e3e8ff73b7b6d371bb942acd588cc792 to your computer and use it in GitHub Desktop.
Make a single file with all tests for karma to consume
// Simplified config file
const path = require('path');
const junitOutput = process.env.CIRCLE_TEST_REPORTS || 'junit'
module.exports = function (config) {
config.set({
port: 9876,
logLevel: config.LOG_INFO,
browsers: ['PhantomJS'],
frameworks: ['jasmine', 'sinon', 'browserify'],
reporters: ['spec'],
files: [{
pattern: 'tests.webpack.js'
}],
preprocessors: {
'tests.webpack.js': ['webpack', 'sourcemap']
}
});
};
(function() {
// require all modules ending in ".test.js" from the
// current directory and all subdirectories
var specs = require.context('./app', true, /\.spec\.js$/),
actions = require.context('./app/actions', true, /\.js$/),
components = require.context('./app/components', true, /\.js$/),
containers = require.context('./app/containers', true, /\.js$/),
reducers = require.context('./app/reducers', true, /\.js$/),
utils = require.context('./app/utils', true, /\.js$/);
[
specs,
actions,
components,
containers,
reducers,
utils
].forEach(function(type) {
type.keys().forEach(type);
});
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment