jest-community / jest-runner-eslint

An ESLint runner for Jest
MIT License
480 stars 46 forks source link

Show skipped filenames as "skipped" in yellow #9

Open ljharb opened 7 years ago

ljharb commented 7 years ago

I'd like to see, alongside green PASS and red FAIL, a yellow SKIP when a file is eslintignored (to match up with the nice new skip count).

It'd also be nice if there was an option to suppress reporting these skipped tests (but showing them by default).

rogeliog commented 7 years ago

I'm not sure if Jest's reporter provides this feature, I think it doesn't but I might be wrong... If this is the case, then it would be harder to implement this because it might require changes in facebook/jest

rogeliog commented 7 years ago

One thing that might help to mitigate the issue is adding the files/globs to testPathIgnorePatterns

ljharb commented 7 years ago

I don't want to duplicate the contents of .eslintignore tho - it totally would be nice to have the runner count up the number of ignored files, add that as a skip count (and explicit SKIP entries), and then use them in testPathIgnorePatterns to make the eslint run even faster :-D

rogeliog commented 7 years ago

I agree, this would be great!

@cpojer there is no way that this could be achieved in the current version of Jest right?

ljharb commented 7 years ago

Don't pending tests show up in yellow in jest? That's what I'd assume ignored files would show up as.

cpojer commented 7 years ago

Yeah, I think this should work if in the eslint runner you report all tests within a file as skipped.

rogeliog commented 7 years ago

Hmmm, I think I'm missing something sorry 😞

Isn't it that it could either show this when skipping all the tests

screen shot 2017-09-12 at 9 59 28 am

or this when skipping the test suite?

screen shot 2017-09-12 at 10 01 36 am
ljharb commented 7 years ago

In the case of the eslint runner, there's only 1 test per file, and 1 file per test suite, so both should be marked skipped, no?

cpojer commented 7 years ago

@rogeliog what about setting https://github.com/rogeliog/jest-runner-eslint/blob/master/src/utils/toTestResult.js#L18 and https://github.com/rogeliog/jest-runner-eslint/blob/master/src/utils/toTestResult.js#L13 ?