1.0.0 • Published 8 years ago

storybook-channel-mock v1.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Storybook Channel Mock

Build Status semantic-release Commitizen friendly

Storybook Channel Mock allows you to mock a storybook channel in your unit tests.

Usage in your tests

import addons from '@kadira/storybook-addons'
import createMockChannel from 'storybook-channel-mock';


describe('some storybook add-on', () => {
  let channel;

  beforeEach(() => {
    channel = createMockChannel();
    addons.setChannel(channel);
  });

  it('should be possible to message', () => {
      // channel.emit('my/type', { ... });
      // or your code that uses addons.getChannel()
  });
});