Add npm start to e2e test

This commit is contained in:
Dan Abramov
2016-07-20 14:27:32 +01:00
parent 63610622a2
commit e1ff147b7d
2 changed files with 18 additions and 1 deletions

View File

@@ -15,7 +15,18 @@ var config = require('../config/webpack.config.dev');
var execSync = require('child_process').execSync;
var opn = require('opn');
new WebpackDevServer(webpack(config), {
var handleCompile;
if (process.argv[2] === '--smoke-test') {
handleCompile = function (err, stats) {
if (err || stats.toJson().errors.length || stats.toJson().warnings.length) {
process.exit(1);
} else {
process.exit(0);
}
};
}
new WebpackDevServer(webpack(config, handleCompile), {
publicPath: config.output.publicPath,
historyApiFallback: true,
stats: {