test-runner icon indicating copy to clipboard operation
test-runner copied to clipboard

Add support to `--reporters` flag from Jest

Open rhuanbarreto opened this issue 3 years ago • 2 comments

This feature will enable me report test results in a junit file format using the flags:

--reporters=default --reporters=jest-junit

This will add the possibility to integrate the test runner more tightly in my CI

rhuanbarreto avatar Jun 23 '22 13:06 rhuanbarreto

Hey @rhuanbarreto I think you could achieve that directly when running nyc (decoupled from the test runner), by passing reporters to it. Is that the case?

yannbf avatar Jun 24 '22 13:06 yannbf

nyc works only for code coverage results. Those flags are for Jest reporting the test results for each story run and its play functions.

rhuanbarreto avatar Jun 24 '22 14:06 rhuanbarreto

@yannbf for the nyc report, the default is text, so can't we remove --reporter=text from

https://github.com/storybookjs/test-runner/blob/380ed6c3ad6a02b0b71d9b9c55b097e9fbd63fee/bin/test-storybook.js#L66

Then this would respect the reporter from any .nycrc file if present?

Alternatively perhaps the nyc reporter could be a config option? I should have time to work on this if it's wanted.

penx avatar Sep 29 '22 16:09 penx

For me v0.6.4 solves the issue. I'm closing it then.

rhuanbarreto avatar Oct 03 '22 11:10 rhuanbarreto