-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix(reporter)!: move ctx.log
to ctx.logger.log
, improve log flicking
#1166
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
Conversation
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
We should also change the message on clearScreen to required string |
we can add |
with |
It does reduce the "flicker" on linux too. However i have 2 concerns with this
|
The feedback issue is interesting. It is expected in a web app HMR but here it may be surprising as you suggest. I think it could still lead to a better DX, but we may need to give feedback somehow. Maybe a color flash for the error? But it starts to get more complex... IMO this is still good, but it isnt straightforward at the end |
@dominikg about the first entry, it is internal and used only when rerun tests on changes or when deleting tests @patak-dev maybe we can randomize the On Vite we have a plugin to delay the dev server startup, also a plugin to notify HMR updates on dev, maybe we can add here a system notification (joking) 😂 (https://github.com/mikaelbr/node-notifier) |
# Conflicts: # pnpm-lock.yaml
Changing the color of RERUN is interesting, but it may also be confusing to users. Maybe we could add a char next to rerun that changes from one run to the next? There seem to be some good ones: 2 steps:
4 steps:
|
Maybe we can add a number of reruns to |
|
The problem it is global, we should add one per test: the RERUN log is about the current test, not the global, and also what happens when pressing |
So, what's up with this PR? 👁️ 👁️ |
@sheremet-va: with the latest tests I did, it seems that we need to change the way we send the messages to the console, the flicker can't be removed as we do now (IIRC, the command to clean and to run the tests is produce from different modules and in an asynchronous way), I need to review it (I'll try to pick it up on my vacation): anyway, the PR is in draft, you can close it, but don't delete the branch (a few weeks ago I cleaned my laptop and I don't know if I have it locally) |
I think @antfu wanted to play a bit with it too, as he wasn't sure about the best way to show feedback to the user. I think that if the flicker can be removed from a technical POV, then Vitest could show the "rerun" feedback better than using it. The 4 steps still look acceptable to me
Here it is added to the Rerun button in a video by @userquin from before in the thread: https://streamable.com/6ipv4b |
I love how stable it is, and I understand the idea but at least to me it feels strange that the console will keep constantly updating. It could be distracting while looking at the results. If you go this way, I would prefer a single "Updated" is shown and then it disappears. When updating too quickly, the Updated may not disappear between updates but it is fine since the last time it goes away is enough feedback. Maybe it could be full bright first, and then go with a low-key color, then disappear, kind of like an opacity animation. |
Kapture.2022-07-09.at.01.34.12.mp4🫠 |
on windows also looks good, there is no flickering, the |
ctx.log
to ctx.logger.log
, improve log flicking
Merging this for now and we can iterates if later we have better idea of presenting the updates |
Instead clearing the screen when requested, we just store the message (usually the RERUN XXX message) and then on first log/error received we check if we have the pending log/error and log to the console the pending log/error and the message at once.
https://streamable.com/92bizj
EDIT: only tested on IntelliJ on windows, we should check it also on macos and linux and also on VSCode. We also need to check it on multiple tests changes.
@dominikg can you check this on linux on
IntelliJ/WebStorm
(sorry to ping you direclty)