Open Haroenv opened 6 years ago
I kinda handle this in jest-runner-tslint
. I mark the test as passing but still provide a formatted output with the warnings. Would that work here?
Skipped and warn could indeed probably use the same UI
@Haroenv I agree that it could, but I don't think that it should.
I think that skipped should only be used for files that are actually skipped by the linter, but files with just warnings should be marked as passed and print their warnings.
I definitely don't think they should be the same.
However, I'm not sure I'm comfortable with marking warnings as "passed" while still printing the output (but I don't have a better suggestion)
Hi! Thanks for reporting and sorry for the late response, I've been sick
Yeah I agree that it is a bit weird. I think this type of examples are great for maturing the jest-runners in general, given that right now it works specifically for Jest use cases, but there areas like this could be generalized to support this use cases
In a project I'm working on, we treat warnings and errors more-or-less the same (we run eslint in CI with --max-warnings 0
), but we use both errors and warnings because it's nice to see different colors for different things in the editor. In order to get warnings to count as failures with jest-runner-eslint
, I wrote a second config that pulls in our normal config and changes all the "warn"s to "error". Then I tell jest-runner-eslint
to use that config using the cliOptions.config
option.
This is not a feature of jest, but it's useful to keep things as a warning when you know that a project isn't finished yet. For example todo comments are useful to keep track of where you are in finishing, but also still useful to see in the tests, without needing to fail for it.