storybook-channel-mock

1.0.0 • Public • Published

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()
  });
});

Readme

Keywords

none

Package Sidebar

Install

npm i storybook-channel-mock

Weekly Downloads

3

Version

1.0.0

License

MIT

Last publish

Collaborators

  • joscha