-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
refactor(e2e): turn repeated test (build and start) into function #312
Conversation
TIL you can have functions in bash scripts! |
3fbc048
to
d5fcafc
Compare
d5fcafc
to
158d49b
Compare
@@ -28,6 +28,30 @@ function handle_exit { | |||
exit | |||
} | |||
|
|||
function build_check { | |||
local test_snap_path="$1" | |||
if [ -z "$1" ] |
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.
When would it be empty? We seem to always pass it.
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.
Yes, we always passed in snap file path in the 3 tests.
I am thinking what the build_check
should behave when it is called without given $1.
-- option 1: delete the if check, let the function fall and let developer knows that Jest test is mandatory
-- option 2: use the following code, skip Jest test when there is no $1
if [ -z "$1" ]
then
test -e $1
fi
I will update the code when received your suggestion.
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.
This is just an end-to-end test that we run for this tool, the developer won’t see it.
So relying on jest existing is fine here.
158d49b
to
6306d90
Compare
6306d90
to
056236d
Compare
b6826ef
to
33be307
Compare
33be307
to
6306d90
Compare
6306d90
to
ea6d7ca
Compare
ea6d7ca
to
3eddc77
Compare
Thanks again for the PR. Sorry it’s getting out of date. There are a few more important changes I wanted to get in first but I’m keeping an eye on this one. It should be good to go after #419 is merged so I’ll get back to it and ask you to update 😄 . Thank you! |
This PR is to clean up e2e.sh. It makes sense to do this after other important changes. |
I’m closing because this got out of date. |
There are 3 build-and-start tests in the current
e2e.sh
.I placed repeated code in a function.
In the first test, if there is a reason why
npm start -- --smoke-test
should run beforenpm run build
, I will extractnpm start -- --smoke-test
out of functionbuild_check
.