FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

refactor(e2e): turn repeated test (build and start) into function by Jiansen · Pull Request #312 · react/create-react-app · GitHub

refactor(e2e): turn repeated test (build and start) into function - #312

Closed
Jiansen wants to merge 1 commit into
react:masterfrom
Jiansen:e2e-build-check
Closed

refactor(e2e): turn repeated test (build and start) into function#312
Jiansen wants to merge 1 commit into
react:masterfrom
Jiansen:e2e-build-check

Conversation

Jiansen commented Aug 1, 2016

Copy link
Copy Markdown
Contributor

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 before npm run build, I will extract npm start -- --smoke-test out of function build_check.

ghost added the CLA Signed label Aug 1, 2016

mxstbr commented Aug 1, 2016

Copy link
Copy Markdown
Contributor

TIL you can have functions in bash scripts!

Jiansen commented Aug 1, 2016

Copy link
Copy Markdown
Contributor Author

TIL you can have functions in bash scripts!

@mxstbr , I leant from @ltk ( #244 ) just a few days ago :-)

ghost added the CLA Signed label Aug 1, 2016
ghost added the CLA Signed label Aug 2, 2016
ghost added the CLA Signed label Aug 2, 2016
Comment thread tasks/e2e.sh Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

When would it be empty? We seem to always pass it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

ghost added the CLA Signed label Aug 4, 2016
ghost added the CLA Signed label Aug 8, 2016
ghost added the CLA Signed label Aug 9, 2016
ghost added the CLA Signed label Aug 20, 2016

gaearon commented Sep 2, 2016

Copy link
Copy Markdown
Contributor

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!

Jiansen commented Sep 2, 2016

Copy link
Copy Markdown
Contributor Author

This PR is to clean up e2e.sh. It makes sense to do this after other important changes.

gaearon commented Sep 30, 2016

Copy link
Copy Markdown
Contributor

I’m closing because this got out of date.
I’ll be happy to merge it if you rebase, so feel free to send another PR!
Thank you for your contributions.

gaearon closed this Sep 30, 2016
lock Bot locked and limited conversation to collaborators Jan 22, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants


Back | FazBrowse Home | New Git URL