mthuret / storybook-addon-specifications

:book: Write tests next to your stories and display their results inside storybook interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

storybook upgrade from 5.1.1 -> 5.2.1, specs block not executed

engelmav opened this issue · comments

Hello,

After storybook upgrade from 5.1.1 to 5.2.1, the specs function (or it function) is either not executed or failing silently somewhere, because the assignments that happen within the it block are not happening.

Example:

  // storiesOf() above here
  .add('after changing state',
    () => {
      configure({ adapter: new Adapter() });
      const story = <MyComponent {...someProps} />;
      let output;

      specs(() => describe('Classification', function () {
        it('Component state change', function () {
          output = mount(story);
          output.setProps({ someProps });
          output.setState({ someState: stateData });
        });
      }));
      const Inst = () => output.instance();
      return <Inst {...someProps} />;
    }
  );

When viewing this in storybook UI, I see TypeError: Cannot read property 'instance' of undefined.

Do I need to change how I invoke the specifications addon for this version of storybook, or is this a breaking change on storybook's side?

I'm happy to contribute a bugfix if someone can point me to where the specification addon interfaces with storybook for specs/it loading.