-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Testing console output #10
Comments
That is a easy fix I will add the test renderer as default. |
If it’s configurable I can also set EDIT: thanks! |
Added a test renderer with #11, published with version 1.3.8. Take a look at Logger and Test Renderer for expected outputs on the given occasion. But they are all text-based now. I will also add automated tests hopefully soon. As mentioned you can pass in test renderer with |
For any more issues, I kindly ask you to please open up a new issue, hopefully I was helpful! Have a nice day. I will be watching the thread. |
Thanks, seems to be just what we need! I'll also use the test renderer when |
What you can also do is to set fallback renderer to test instead of the verbose by passing in |
@iiroj I kindly wanted to inform you about the upcoming changes beforehand. For further updates with Listr2 there had to be breaking changes how the renderer options get passed in, I just wanted to go ahead and kindly inform you about the breaking changes that were discussed on the original repository by SamVerschueren in Originally posted by @SamVerschueren in SamVerschueren/listr#143 (comment). This will affect how the renderer and task-scoped renderer options get passed in. This can be seen in detail in here. While doing that I also exchanged the 'test' renderer which you are mainly using back to 'verbose' since verbose renderer does not use icons anymore and they are basically the same now. So this will not require a major refactoring and a ctrl+h would be more than enough. Some of the issues about the collection of errors which can be seen here and cli-truncate functionality has been fixed that you mentioned here in this pull request. |
@cenk1cenk2 thanks for the info! I'll see about migrating to it. Since I already moved the error collecting out of the old behaviour of listr before this, does this affect lint-staged? It was a good change to do in lint-staged IMO since it streamlined the collection of task output (other than errors). I assume I will have to at least change the |
Sorry to ask an otherwise unrelated question, but does the inclusion of |
I think it should not cause any problems for the errors because error collection is done out of the context. So after the task has been run, you shoud access the errors via const task = new Listr(...)
const ctx = await task.run()
logger.fail(task.err)
// will show all of the errors that are encountered through execution If your cli-truncate action relies on Only thing that may need refactoring is the rendererOptions. They now have their own key and not set from the root of the options and they will change their autocomplete functionallity based on which renderer is selected. This can be seen here in detail. I have also removed test renderer which you are using for the tests since I equalize verbose and test renderer in a way that verbose renderer now has their icon output as optionals. So since they are basically the same thing now and verbose seemed like a better naming scheme then test, I removed test renderer. But this should be a matter of find&replace |
Hello,
we're in the process of migrating lint-staged to Listr2, but I have some question regarding test output assertion.
The orginal Listr's verbose renderer printed
[started]
and[completed]
strings, while Listr2 uses fancy symbols like❯
and✔
. These symbols are different on each platform, though, so testing in a CI environment is a bit difficult.You can see the progress in the PR lint-staged/lint-staged#852 and how the assertions fail on our Windows tests: https://ci.appveyor.com/project/okonet/lint-staged/builds/32413566/job/qyae7t039cckykre
The text was updated successfully, but these errors were encountered: