mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
Apply suggestions from code review
Co-authored-by: Valentin Palkovic <valentin@chromatic.com>
This commit is contained in:
parent
2d3fd3606d
commit
bf5f7831d1
@ -36,10 +36,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -13,10 +13,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -19,10 +19,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -14,7 +14,7 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
|
@ -11,10 +11,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -19,10 +19,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -16,10 +16,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -19,10 +19,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -14,10 +14,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -13,10 +13,10 @@ function load(options: StoryshotsOptions) {
|
||||
let mockStartedAPI: any;
|
||||
|
||||
jest.mock('@storybook/preview-api', () => {
|
||||
const coreClientAPI = jest.requireActual('@storybook/preview-api');
|
||||
const previewAPI = jest.requireActual('@storybook/preview-api');
|
||||
|
||||
return {
|
||||
...coreClientAPI,
|
||||
...previewAPI,
|
||||
start: (...args: any[]) => {
|
||||
mockStartedAPI = coreClientAPI.start(...args);
|
||||
return mockStartedAPI;
|
||||
|
@ -59,7 +59,6 @@
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/preset-typescript": "^7.18.6",
|
||||
"@storybook/addons": "7.0.0-alpha.52",
|
||||
"@storybook/builder-webpack5": "7.0.0-alpha.52",
|
||||
"@storybook/core-common": "7.0.0-alpha.52",
|
||||
|
@ -1,3 +1 @@
|
||||
import type { DocsContextProps } from '@storybook/types';
|
||||
|
||||
export { DocsContextProps };
|
||||
export type { DocsContextProps } from '@storybook/types';
|
||||
|
@ -1,3 +1 @@
|
||||
import type { DocsRenderFunction } from '@storybook/types';
|
||||
|
||||
export type { DocsRenderFunction };
|
||||
export type { DocsRenderFunction } from '@storybook/types';
|
||||
|
@ -92,7 +92,7 @@ describe('client-api.decorators', () => {
|
||||
// the same story twice at the same time.
|
||||
it('does not interleave contexts if two decorated stories are call simultaneously', async () => {
|
||||
const contexts: StoryContext[] = [];
|
||||
let resolve: any;
|
||||
let resolve: (value: unknown) => void;
|
||||
const fence = new Promise((r) => {
|
||||
resolve = r;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user