Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global decorators cause Storyshots to fail #1625

Closed
duro opened this issue Aug 8, 2017 · 3 comments
Closed

Global decorators cause Storyshots to fail #1625

duro opened this issue Aug 8, 2017 · 3 comments

Comments

@duro
Copy link

duro commented Aug 8, 2017

Surfacing this again from #877.

When I add a global decorator to .storybook/config.js it cuases my Storyshot tests to fail with:

src/components/__test__/Storyshots.test.js
  ● Test suite failed to run

    Global decorators added after loading stories will not be applied

      at ClientApi.addDecorator (node_modules/@storybook/react/dist/client/preview/client_api.js:55:15)
      at evalmachine.<anonymous>:13:25
      at runWithRequireContext (node_modules/@storybook/addon-storyshots/dist/require_context.js:102:3)
      at testStorySnapshots (node_modules/@storybook/addon-storyshots/dist/index.js:100:35)
      at Object.<anonymous> (src/components/__test__/Storyshots.test.js:3:31)
          at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:188:7)
@evenchange4
Copy link
Contributor

evenchange4 commented Aug 21, 2017

Here is a simple workaround which mocking addDecorator as an emptyFunction in my project.

// Storyshots.test.js
import initStoryshots from '@storybook/addon-storyshots'

const sbReact = require('@storybook/react')
sbReact.addDecorator = () => {}

initStoryshots()

@usulpro usulpro added decorators and removed bug labels Sep 15, 2017
@stale
Copy link

stale bot commented Nov 2, 2017

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. We do try to do some housekeeping every once in a while so inactive issues will get closed after 90 days. Thanks!

@stale stale bot added the inactive label Nov 2, 2017
@stale
Copy link

stale bot commented Nov 17, 2017

Hey there, it's me again! I am going close this issue to help our maintainers focus on the current development roadmap instead. If the issue mentioned is still a concern, please open a new ticket and mention this old one. Cheers and thanks for using Storybook!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants