4.0.0 • Published 1 year ago

@chanzuckerberg/story-utils v4.0.0

Weekly downloads
462
License
MIT
Repository
github
Last release
1 year ago

story-utils

Utilities for using Storybook stories in non-Storybook environments. For example, using stories in Jest tests.

Requirements

  • Storybook 7 (if you're using Storybook 6, use story-utils@v3)

Installation

Install @chanzuckerberg/story-utils with your favorite package manager. With yarn, that would look like

yarn add --dev @chanzuckerberg/story-utils

Utilities

generateSnapshots

Auto generates snapshots for stories

import * as snapshotTestStoryFile from "./MyButton.stories";
import { generateSnapshots } from "@chanzuckerberg/story-utils";

describe("My button", () => {
  generateSnapshots(snapshotTestStoryFile);
});

If you want to skip generating snapshots for a story:

SomeStory.parameters = {
  snapshot: {
    skip: true,
  },
};
3.0.14

1 year ago

4.0.0

1 year ago

3.0.13

1 year ago

3.0.12

1 year ago

3.0.11

1 year ago

3.0.9

2 years ago

3.0.10

1 year ago

3.0.9-alpha.0

2 years ago

3.0.8

2 years ago

3.0.7

2 years ago

3.0.6

2 years ago

3.0.5

2 years ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

3.0.0-alpha.16

2 years ago

3.0.0-alpha.17

2 years ago

2.1.0

3 years ago

2.0.1-alpha.12

3 years ago

2.0.0

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.0-alpha.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago

0.1.0-alpha.1

3 years ago