Skip to content

Commit

Permalink
fix(storyshots): match typings of "test"-method to real usage
Browse files Browse the repository at this point in the history
closes #12361
  • Loading branch information
nknapp committed Sep 5, 2020
1 parent 194c07d commit 1e802aa
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion addons/storyshots/storyshots-core/src/api/StoryshotsOptions.ts
Expand Up @@ -3,6 +3,24 @@ import { Stories2SnapsConverter } from '../Stories2SnapsConverter';
import { SupportedFramework } from '../frameworks';
import { RenderTree } from '../frameworks/Loader';

export interface TestMethodOptions {
story: any;
context: any;
renderTree: RenderTree;
renderShallowTree: RenderTree;
stories2snapsConverter: Stories2SnapsConverter;
snapshotFileName: string;
options: any;
}

export interface StoryshotsTestMethod {
(args: TestMethodOptions): any;
beforeAll?: () => void | Promise<void>;
beforeEach?: () => void | Promise<void>;
afterAll?: () => void | Promise<void>;
afterEach?: () => void | Promise<void>;
}

export interface StoryshotsOptions {
asyncJest?: boolean;
config?: (options: any) => void;
Expand All @@ -12,7 +30,7 @@ export interface StoryshotsOptions {
storyKindRegex?: RegExp | string;
storyNameRegex?: RegExp | string;
framework?: SupportedFramework;
test?: (story: any, context: any, renderTree: RenderTree, options?: any) => any;
test?: StoryshotsTestMethod;
renderer?: Function;
snapshotSerializers?: jest.SnapshotSerializerPlugin[];
/**
Expand Down

0 comments on commit 1e802aa

Please sign in to comment.