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

chore: use HTML reporter when --ui flag is used in run mode. #2915

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

mysteryven
Copy link
Contributor

@mysteryven mysteryven commented Feb 24, 2023

close: #2897

Copy link
Member

@sheremet-va sheremet-va left a comment

Choose a reason for hiding this comment

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

#2897 expects that html reporter will be used when --ui flag is used in --run mode

@@ -207,7 +207,7 @@ export async function VitestPlugin(options: UserConfig = {}, ctx = new Vitest('t
: []),
...CSSEnablerPlugin(ctx),
CoverageTransform(ctx),
options.ui
(options.ui && options.watch !== false)
Copy link
Member

Choose a reason for hiding this comment

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

watch can be changed in the config file. These options are from the CLI

@mysteryven mysteryven changed the title chore: not inject UIPlugin if disable watch mode chore: use HTML reporter when --ui flag is used in run mode. Feb 26, 2023
@mysteryven mysteryven force-pushed the chore/only-use-ui-plugin-in-watch branch from 5f697ad to e122cb6 Compare February 26, 2023 05:37
@Weetbix
Copy link

Weetbix commented Feb 27, 2023

#2897 expects that html reporter will be used when --ui flag is used in --run mode

I was expecting that when --ui flag is used with --run, the ui server starts up and shows the test results as they are being ran. After the run the page would become static (as vitest and the ui server shuts down). My test suite is large and takes about 2 minutes to run, but I still want to see the results and any errors "live" as they are running.

This PR is still an improvement though 👍 , looks like it removes the UI server and instead generates a html report at the end of the test run. I think this means less confusion, but for me I will not use this report at the end of the test run.

@mysteryven
Copy link
Contributor Author

the ui server starts up and shows the test results as they are being ran.

Run npx vite preview --base __vitest__ --outDir ./html manually can preview it as a static server in run mode, but I think you know this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI never connects when using run
3 participants