/storybook-har-addon

GNU General Public License v3.0GPL-3.0

Mock Storybook

Record & mock your stories with HAR files.

Installation

pnpm add mock-storybook --dev
// .storybook/preview.js
export const loaders = withMocks({})([
  ...
])

Then, in your story:

```js
Story.parameters = {
  mock: {
    har: require('./path/to.har'),
    handlers: [

    ]
  }
}

Local Workflow

  1. Automate your story with a .play() function via Interactions.

  2. Capture a .har file:

    Manually

    See How to get a HAR capture

    Automatically

    1. Setup test-storybook
    2. Run test-storybook
    3. TODO – Automatically capture .har relative to story?