Skip to content

Commit

Permalink
use custom zod types for function args
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Nov 18, 2023
1 parent 1e9d8c2 commit 32ccfc0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { existsSync } from 'node:fs';
import path from 'node:path';
// import type { BrowserContextOptions, Page } from 'playwright-core';
import type { BrowserContextOptions, Page } from 'playwright-core';
import z from 'zod';
import { loadProjectConfigFile, loadTSProjectConfigFile } from './configHelper';
import { log } from './log';
Expand Down Expand Up @@ -337,15 +337,15 @@ const BaseConfigSchema = z.object({
configureBrowser: z
.function()
.args(StoryLikeSchema)
.returns(z.any())
.returns(z.custom<BrowserContextOptions>())
.optional(),

/**
* Configure page before screenshot
*/
beforeScreenshot: z
.function()
.args(z.any(), StoryLikeSchema)
.args(z.custom<Page>(), StoryLikeSchema)
.returns(z.promise(z.void()))
.optional(),
});
Expand Down

0 comments on commit 32ccfc0

Please sign in to comment.