Skip to content

Commit

Permalink
integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Balestra committed Jan 12, 2017
1 parent 57911f3 commit cde708d
Show file tree
Hide file tree
Showing 6 changed files with 209 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@ var strings = require('../../../../../resources');


module.exports = function externalDependenciesHandlers(dependencies){
var deps = dependencies || {}
var deps = dependencies || {};

var missingExternalDependecy = function(dep, dependencies) {
return !_.contains(_.keys(dependencies), dep);
}
};

return [
function(context, req, callback) {
if (/^[a-z@][a-z\-\/0-9]+$/.test(req)) {
var dependencyName = req;
if (/\//g.test(dependencyName)) {
dependencyName = dependencyName.substring(0, dependencyName.indexOf("/"));
dependencyName = dependencyName.substring(0, dependencyName.indexOf('/'));
}
if (missingExternalDependecy(dependencyName, deps)) {
return callback(new Error(format(strings.errors.cli.SERVERJS_DEPENDENCY_NOT_DECLARED, JSON.stringify(dependencyName))));
}
}
callback()
callback();
},
/^[a-z@][a-z\-\/0-9]+$/
]
];
};


16 changes: 8 additions & 8 deletions src/cli/domain/package-server-script/bundle/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = function webpackConfigGenerator(params){
loaders: [
'falafel-loader',
'babel-loader?' + JSON.stringify({
cacheDirectory: false,
cacheDirectory: true,
'presets': [
['env', {
'targets': {
Expand All @@ -43,13 +43,13 @@ module.exports = function webpackConfigGenerator(params){
},
plugins: [
new webpack.optimize.OccurenceOrderPlugin(),
// new webpack.optimize.UglifyJsPlugin({
// compressor: {
// warnings: false,
// screw_ie8: true
// },
// sourceMap: false
// }),
new webpack.optimize.UglifyJsPlugin({
compressor: {
warnings: false,
screw_ie8: true
},
sourceMap: false
}),
new webpack.DefinePlugin({
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function wrapLoops(node){
}

if(loopKeywords.indexOf(node.parent.type) > -1 && node.type === 'BlockStatement'){
node.update('{ if(__ITER <=0){ throw new Error("loop exceeded maximum '
node.update('{ if(__ITER <=0){ throw new Error("Loop exceeded maximum '
+ 'allowed iterations"); } '
+ node.source().substr(1).slice(0, -1)
+ ' __ITER--; }'
Expand Down
4 changes: 2 additions & 2 deletions src/cli/domain/package-server-script/bundle/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var webpack = require('webpack');
var memoryFs = new MemoryFS();

module.exports = function bundle(params, callBack) {
var config = webpackConfig(params)
var config = webpackConfig(params);
var compiler = webpack(config);
compiler.outputFileSystem = memoryFs;

Expand Down Expand Up @@ -39,4 +39,4 @@ module.exports = function bundle(params, callBack) {
var serverContentBundled = memoryFs.readFileSync('/build/server.js', 'UTF8');
callBack(warning, serverContentBundled);
});
}
};
2 changes: 1 addition & 1 deletion src/cli/domain/package-server-script/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var webpackDefaults = {
};

module.exports = function packageServerScript(params, callback){
var fileName = 'server.js'
var fileName = 'server.js';
var publishPath = params.publishPath;

var bundleParams = {
Expand Down
Loading

0 comments on commit cde708d

Please sign in to comment.