generated from storybookjs/addon-kit
-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Jest 28 released with Github Action reporter support, meaning that failing tests can get annotations in the changed files view.
With jest config ejection, you can set reporters: ['default', 'github-actions'],, but it'd be great to have this as a default for users who aren't going to go through the effort of exploring this feature.
Additionally, I'm struggling to get the actual annotations to show up, rather than just seeing the filename have a red dot next to it...
Helpfully, the github action reporter will only do any reporting if the GITHUB_ACTION env variable is set.
Describe the solution you'd like
Change the default config for test-runner to:
// @ts-check
import { getJestConfig } from '@storybook/test-runner';
// The default Jest configuration comes from @storybook/test-runner
const testRunnerConfig = getJestConfig();
/**
* @type {ReturnType<import('@storybook/test-runner').getJestConfig>}
*/
export default {
...testRunnerConfig,
/** Add your own overrides below, and make sure
* to merge testRunnerConfig properties with your own
* @see https://jestjs.io/docs/configuration
*/
reporters: ['default', 'github-actions'],
};Describe alternatives you've considered
- Alternatively just leave it up to the user to find this config option and set it.
Are you able to assist to bring the feature to reality?
yes, I can
Additional context
- https://github.com/storybookjs/test-runner/blob/next/src/config/jest-playwright.ts
- https://github.com/storybookjs/test-runner#jest-options
- https://jestjs.io/docs/configuration#reporters-arraymodulename--modulename-options
- https://github.com/jestjs/jest/blob/main/packages/jest-reporters/src/GitHubActionsReporter.ts
- https://jestjs.io/blog/2022/04/25/jest-28#github-actions-reporter
- feat: Add GitHub Actions Reporter jestjs/jest#11320