mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
[@storybook/addon-storyshots] callable renderWithOptions (#36768)
This commit is contained in:
committed by
Andrew Branch
parent
35bd091687
commit
f6ddc0feca
+7
-1
@@ -22,10 +22,16 @@ export type RenderTree = (
|
||||
options?: SnapshotOptions
|
||||
) => undefined | void | Promise<void>;
|
||||
|
||||
export interface SnapshotOptions {
|
||||
export interface SnapshotOptionsObject {
|
||||
createNodeMock?: (element: any) => any;
|
||||
}
|
||||
|
||||
export interface SnapshotOptionsFn {
|
||||
(story: StoryObject): SnapshotOptionsObject;
|
||||
}
|
||||
|
||||
export type SnapshotOptions = SnapshotOptionsObject | SnapshotOptionsFn;
|
||||
|
||||
export interface StoryContext {
|
||||
kind: string;
|
||||
story: string;
|
||||
|
||||
@@ -45,6 +45,16 @@ initStoryshots({
|
||||
})
|
||||
});
|
||||
|
||||
initStoryshots({
|
||||
configPath: '',
|
||||
test: renderWithOptions(story => ({
|
||||
createNodeMock: () => {
|
||||
story.name;
|
||||
return undefined;
|
||||
},
|
||||
})),
|
||||
});
|
||||
|
||||
initStoryshots({
|
||||
configPath: "",
|
||||
test: imageSnapshot({
|
||||
|
||||
Reference in New Issue
Block a user