mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-23 12:48:00 +08:00
Add npm start to e2e test
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user