Skip to content
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

Halt tests if connection is refused #38

Open
carolinan opened this issue Jun 7, 2021 · 1 comment
Open

Halt tests if connection is refused #38

carolinan opened this issue Jun 7, 2021 · 1 comment
Labels
enhancement New feature or request environment

Comments

@carolinan
Copy link
Contributor

I tested npm install inside the ui-check folder and there were no issues.
Then I used npm start and it runs the tests but the connection is refused:

net::ERR_CONNECTION_REFUSED at http://localhost:8889/?feed=rss2

When the connection is refused, I don't think there is any point in continuing with the next test?
I mean that the tests could stop at this error.

@StevenDufresne
Copy link
Contributor

Calling the UI-check directly in the folder is still somewhat problematic because, currently, the tests expect that wp-env configured the environment. After the environment is complete, there are a series of environment configurations that run. Not having those will trigger multiple test failures if manual configurations are not done the same.

Additionally, the project shouldn't get that far if it's run from the top level since it suggests that there is nothing running http://localhost:8889/?feed=rss2 (unless there was another reason for this error), meaning the environment install didn't work and the tests wouldn't work.

Now, if you are adventurous, you can pass in a local port via an environment variable if you still want to test and don't have a local environment configured on port 8889.

export const testPort = process.env.WP_ENV_TESTS_PORT || 8889;

You can try something like: WP_ENV_TESTS_PORT=3000 npm run start.

@StevenDufresne StevenDufresne added enhancement New feature or request environment labels Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request environment
Projects
None yet
Development

No branches or pull requests

2 participants