Skip to content

Commit

Permalink
migrate @storybook/addons-storyshots-puppeteer to strict TS
Browse files Browse the repository at this point in the history
  • Loading branch information
1234tgk committed May 8, 2023
1 parent dd8bfa8 commit d031abd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions code/addons/storyshots-puppeteer/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ interface DirectNavigationOptions {

export interface CommonConfig {
storybookUrl: string;
chromeExecutablePath: string;
getGotoOptions: (options: Options) => DirectNavigationOptions;
chromeExecutablePath?: string;
getGotoOptions: (options: Options) => DirectNavigationOptions | undefined;
customizePage: (page: Page) => Promise<void>;
getCustomBrowser: () => Promise<Browser>;
getCustomBrowser?: () => Promise<Browser>;
/**
* Puppeteer browser launch options:
* {@link https://pptr.dev/api/puppeteer.puppeteernode.launch/ puppeteer.launch()}
Expand All @@ -48,7 +48,7 @@ export interface PuppeteerTestConfig extends CommonConfig {
}

export interface ImageSnapshotConfig extends CommonConfig {
getMatchOptions: (options: Options) => MatchImageSnapshotOptions;
getMatchOptions: (options: Options) => MatchImageSnapshotOptions | undefined;
getScreenshotOptions: (options: Options) => Base64ScreenShotOptions;
beforeScreenshot: (page: Page, options: Options) => Promise<void | ElementHandle>;
afterScreenshot: (options: { image: string | void | Buffer; context: Context }) => Promise<void>;
Expand Down Expand Up @@ -95,11 +95,11 @@ export const defaultImageSnapshotConfig: ImageSnapshotConfig = {
...defaultCommonConfig,
getMatchOptions: noop,
getScreenshotOptions: defaultScreenshotOptions,
beforeScreenshot: noop,
afterScreenshot: noop,
beforeScreenshot: asyncNoop,
afterScreenshot: asyncNoop,
};

export const defaultAxeConfig: AxeConfig = {
...defaultCommonConfig,
beforeAxeTest: noop,
beforeAxeTest: asyncNoop,
};
2 changes: 1 addition & 1 deletion code/addons/storyshots-puppeteer/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"skipLibCheck": true,
"types": ["node"],
"declaration": true,
"strict": false
"strict": true
},
"include": ["src/**/*"]
}

0 comments on commit d031abd

Please sign in to comment.