Skip to content

Instantly share code, notes, and snippets.

@NoriSte
Created December 13, 2022 08:28
Show Gist options
  • Save NoriSte/963f092d92b866feca2035a0b6422589 to your computer and use it in GitHub Desktop.
Save NoriSte/963f092d92b866feca2035a0b6422589 to your computer and use it in GitHub Desktop.
Using Storybook Test Runner on Hasura Console (Dec, 2022)

As of Today, we cannot use the Storybook Test Runner in Hasura's Console codebase because on some machines some tests are flaky.

As a temporary workaround, if you really need it, you can apply the following changes (without committing them) to use it locally.

PLEASE NOTE: Due to the migration to Nx, these steps will not work for a long time, use them only if you benefit a lot from running all tyhe Storybook tests from the terminal!

  1. Install "@storybook/test-runner": "0.6.2",
  2. Add a new script "test-storybook": "test-storybook",
  3. In console/.storybook, add a file called "test-runner-jest.config.js" with the following content
const { getJestConfig } = require('@storybook/test-runner');
const consoleJestConfig = require('../jest.config');

console.log(consoleJestConfig);

module.exports = {
  // The default configuration comes from @storybook/test-runner
  ...getJestConfig(),
  /** Add your own overrides below
   *
   * @see https://jestjs.io/docs/configuration
   */
  ...consoleJestConfig,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment