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

test: fix timeout hiding runtime build error #3185

Merged
merged 2 commits into from
Apr 28, 2021
Merged

test: fix timeout hiding runtime build error #3185

merged 2 commits into from
Apr 28, 2021

Conversation

patak-dev
Copy link
Member

@patak-dev patak-dev commented Apr 28, 2021

Description

Setup for the screenshots: I forced a runtime build error, by using configResolved to get the config in an internal plugin. This is ok according to the public API of vite, but internal plugins don't get this hook called (and you should directly get the config through params).

In the current test output for ssr-react, the build failed but the tests continued to run and trying to use await page.click caused a timeout that is reported and hides the real issue

test-output-initial



This PR closes the page if there is an exception during the test setup, resolving the await and timeout issue. The real error gets properly reported but it is duplicated, as logLevel: 'error' is used to do the builds for the test suite so it is reported both by Vite and by Jest.

test-output-error



To avoid this, the logLevel is set as 'silent' so the only reported exception is logged by Jest

test-output-final



Note: I included both changes in the same PR because in the current test setup we don't have the duplicated log error.

Additional context

The Jest log is a lot better than the one generated internally by Vite, it would be good to see if we could get the same output when the user uses the cli.


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

@patak-dev patak-dev merged commit 978d991 into vitejs:main Apr 28, 2021
@patak-dev patak-dev deleted the test/fix-timeout-hiding-runtime-error branch April 28, 2021 16:50
TobiasMelen pushed a commit to TobiasMelen/vite that referenced this pull request May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants