From f0cc6b2b5a363645253f2d8e8b7a2713161459bd Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 21 Jul 2016 12:29:18 +0200 Subject: [PATCH 1/4] Test local commands --- tests/e2e.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/e2e.sh b/tests/e2e.sh index 21813326dde..70826f1fff7 100755 --- a/tests/e2e.sh +++ b/tests/e2e.sh @@ -30,6 +30,16 @@ perl -i -p0e 's/bundledDependencies.*?]/bundledDependencies": []/s' package.json npm install scripts_path=$PWD/`npm pack` +# Test local start command +npm start -- --smoke-test + +# Test local build command +npm run build + +# Check for expected output +test -e build/*.html || exit 1 +test -e build/*.js || exit 1 + # Pack CLI cd global-cli npm install From 7b406a370a46d886f4b2f306cafc85e52f27f62d Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 21 Jul 2016 18:56:12 +0200 Subject: [PATCH 2/4] Fix check for smoke test --- scripts/start.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/start.js b/scripts/start.js index 720ab102827..f2546f1414d 100644 --- a/scripts/start.js +++ b/scripts/start.js @@ -16,10 +16,14 @@ var config = require('../config/webpack.config.dev'); var execSync = require('child_process').execSync; var opn = require('opn'); +function isSmokeTest() { + return process.argv.some(function (item) { return item.indexOf('--smoke-test') > -1 }); +} + // TODO: hide this behind a flag and eliminate dead code on eject. // This shouldn't be exposed to the user. var handleCompile; -if (process.argv[2] === '--smoke-test') { +if (isSmokeTest()) { handleCompile = function (err, stats) { if (err || stats.hasErrors() || stats.hasWarnings()) { process.exit(1); From 1a593392449676ae2d3a3cce43599c21f36e52e0 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 21 Jul 2016 21:57:10 +0200 Subject: [PATCH 3/4] Fix webpack config --- config/webpack.config.dev.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/webpack.config.dev.js b/config/webpack.config.dev.js index 74a6c9a0b10..e504deef9cf 100644 --- a/config/webpack.config.dev.js +++ b/config/webpack.config.dev.js @@ -12,12 +12,16 @@ var autoprefixer = require('autoprefixer'); var webpack = require('webpack'); var HtmlWebpackPlugin = require('html-webpack-plugin'); +function isInDebugMode() { + return process.argv.some(function (item) { return item.indexOf('--debug-template') > -1 }); +} + // TODO: hide this behind a flag and eliminate dead code on eject. // This shouldn't be exposed to the user. var isInNodeModules = 'node_modules' === path.basename(path.resolve(path.join(__dirname, '..', '..'))); var relativePath = isInNodeModules ? '../../..' : '..'; -if (process.argv[2] === '--debug-template') { +if (isInDebugMode()) { relativePath = '../template'; } var srcPath = path.resolve(__dirname, relativePath, 'src'); From 8966b4be12f98402d8d8b1b11b0dec0671a126e4 Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 22 Jul 2016 07:57:31 +0200 Subject: [PATCH 4/4] Remove || exit 1 --- tasks/e2e.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tasks/e2e.sh b/tasks/e2e.sh index 70826f1fff7..3a732bd0398 100755 --- a/tasks/e2e.sh +++ b/tasks/e2e.sh @@ -37,8 +37,8 @@ npm start -- --smoke-test npm run build # Check for expected output -test -e build/*.html || exit 1 -test -e build/*.js || exit 1 +test -e build/*.html +test -e build/*.js # Pack CLI cd global-cli @@ -60,8 +60,8 @@ cd test-app npm run build # Check for expected output -test -e build/*.html || exit 1 -test -e build/*.js || exit 1 +test -e build/*.html +test -e build/*.js # Test the server npm start -- --smoke-test @@ -71,8 +71,8 @@ echo yes | npm run eject npm run build # Check for expected output -test -e build/*.html || exit 1 -test -e build/*.js || exit 1 +test -e build/*.html +test -e build/*.js # Test the server npm start -- --smoke-test