-
-
Notifications
You must be signed in to change notification settings - Fork 27k
Test local commands #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need the exit 1. We use set -e which bails on any commands that returns non 0 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added those in the first place, I didn’t realize that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done! |
||
test -e build/*.js || exit 1 | ||
|
||
# Pack CLI | ||
cd global-cli | ||
npm install | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn’t
process.argv.indexOf('--smoke-test') > -1
work? Same above.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because
process.argv === ['something', '--debug-template --smoke-test']
.indexOf
an array only works when you're looking for an entire string, e.g. ifprocess.argv === ['something', '--smoke-test']
theindexOf('--smoke-test')
will be bigger than -1.(I thought the same thing at first, but double checked with a JSBin)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aah.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was my reaction too, always learning! 😁