Apply suggestions from code review

Co-authored-by: Valentin Palkovic <valentin@chromatic.com>
This commit is contained in:
Norbert de Langen 2022-11-24 13:00:11 +01:00 committed by GitHub
parent 2d3fd3606d
commit bf5f7831d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 22 additions and 27 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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,

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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",

View File

@ -1,3 +1 @@
import type { DocsContextProps } from '@storybook/types';
export { DocsContextProps };
export type { DocsContextProps } from '@storybook/types';

View File

@ -1,3 +1 @@
import type { DocsRenderFunction } from '@storybook/types';
export type { DocsRenderFunction };
export type { DocsRenderFunction } from '@storybook/types';

View File

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