@beisen/storybook-react
Version:
Storybook for React: Develop React Component in isolation with Hot Reloading.
32 lines (26 loc) • 828 B
JavaScript
;
/* eslint-disable global-require */
describe('preview', function () {
afterEach(function () {
jest.resetModules();
});
var isFunction = function isFunction(value) {
return typeof value === 'function';
};
it('should return the client api in a browser environment', function () {
var api = require('.');
expect(Object.keys(api).length).toBeGreaterThan(0);
expect(Object.values(api).every(isFunction)).toEqual(true);
});
it('should return the client api in a node.js environment', function () {
jest.mock('global', function () {
return {
document: undefined,
window: undefined
};
});
var api = require('.');
expect(Object.keys(api).length).toBeGreaterThan(0);
expect(Object.values(api).every(isFunction)).toEqual(true);
});
});