Skip to content

Commit

Permalink
getSnapshotFileName is not a function (#8964)
Browse files Browse the repository at this point in the history
getSnapshotFileName is not a function
  • Loading branch information
shilman committed Nov 30, 2019
1 parent 767945c commit 36204df
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions addons/storyshots/storyshots-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -653,13 +653,15 @@ This is a class that generates snapshot's name based on the story (kind, story &
Let's say we wanted to create a test function for shallow && multi-file snapshots:

```js
import initStoryshots, { getSnapshotFileName } from '@storybook/addon-storyshots';
import initStoryshots, { Stories2SnapsConverter } from '@storybook/addon-storyshots';
import { shallow } from 'enzyme';
import toJson from 'enzyme-to-json';

const converter = new Stories2SnapsConverter();

initStoryshots({
test: ({ story, context }) => {
const snapshotFileName = getSnapshotFileName(context);
const snapshotFileName = converter.getSnapshotFileName(context);
const storyElement = story.render();
const shallowTree = shallow(storyElement);

Expand Down

0 comments on commit 36204df

Please sign in to comment.