jest-runner-eslint icon indicating copy to clipboard operation
jest-runner-eslint copied to clipboard

Report "warn" somehow

Open Haroenv opened this issue 6 years ago • 7 comments

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.

Haroenv avatar Dec 21 '17 13:12 Haroenv

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?

keplersj avatar Dec 21 '17 18:12 keplersj

#9 is for reporting ignored files; it would be nice to also have a way to display warnings (but i'm fine if it's not the default).

ljharb avatar Dec 21 '17 19:12 ljharb

Skipped and warn could indeed probably use the same UI

Haroenv avatar Dec 21 '17 22:12 Haroenv

@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.

keplersj avatar Dec 21 '17 23:12 keplersj

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)

ljharb avatar Dec 22 '17 03:12 ljharb

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

rogeliog avatar Dec 26 '17 17:12 rogeliog

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.

suchipi avatar Apr 04 '18 17:04 suchipi