Skip to content

[Feature request]: Add Github Actions reporter #581

@jasikpark

Description

@jasikpark

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions