Add mocha test bundling with webpack and test running
This commit is contained in:
@ -1,8 +1,10 @@
|
||||
var path = require('path'),
|
||||
fs = require('fs');
|
||||
fs = require('fs'),
|
||||
_ = require('underscore'),
|
||||
baseConfig;
|
||||
|
||||
// webpack.config.js
|
||||
module.exports = {
|
||||
baseConfig = {
|
||||
name: 'main',
|
||||
context: __dirname ,
|
||||
entry: {
|
||||
admin: './assets/js/admin.js',
|
||||
@ -46,3 +48,30 @@ module.exports = {
|
||||
'jquery': 'jQuery',
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = [
|
||||
baseConfig,
|
||||
|
||||
// Configuration specific for testing
|
||||
_.extend({}, baseConfig, {
|
||||
name: 'test',
|
||||
entry: {
|
||||
testAjax: 'testAjax.js',
|
||||
},
|
||||
output: {
|
||||
path: './tests/javascript/testBundles',
|
||||
filename: '[name].js',
|
||||
},
|
||||
resolve: {
|
||||
modulesDirectories: [
|
||||
'node_modules',
|
||||
'assets/js',
|
||||
'tests/javascript/newsletter_editor'
|
||||
],
|
||||
fallback: path.join(__dirname, 'node_modules'),
|
||||
alias: {
|
||||
'handlebars': 'handlebars/runtime.js'
|
||||
}
|
||||
},
|
||||
})
|
||||
];
|
||||
|
Reference in New Issue
Block a user