storybook-channel-mock
v1.0.0
Published
Mocks a storybook channel for testing purposes
Downloads
17
Readme
Storybook Channel Mock
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()
});
});