mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-04-22 08:26:21 +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: {
|
||||
|
||||
@@ -43,6 +43,9 @@ npm run build
|
||||
test -e build/*.html || exit 1
|
||||
test -e build/*.js || exit 1
|
||||
|
||||
# Test the server
|
||||
npm start -- --smoke-test
|
||||
|
||||
# Eject and test the build
|
||||
echo yes | npm run eject
|
||||
npm run build
|
||||
@@ -51,6 +54,9 @@ npm run build
|
||||
test -e build/*.html || exit 1
|
||||
test -e build/*.js || exit 1
|
||||
|
||||
# Test the server
|
||||
npm start -- --smoke-test
|
||||
|
||||
# Cleanup
|
||||
cd $initial_path
|
||||
rm -rf $temp_cli_path $temp_app_path
|
||||
|
||||
Reference in New Issue
Block a user