Skip to content

Commit

Permalink
handle multiple browser config
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskalmar committed Jan 14, 2024
1 parent 4bce039 commit 1c62ff2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { BrowserContextOptions, Page } from 'playwright-core';
import z from 'zod';
import { loadProjectConfigFile, loadTSProjectConfigFile } from './configHelper';
import { log } from './log';
import { ShotModeSchema } from './types';
import { BrowserSchema, ShotModeSchema } from './types';

const MaskSchema = z.object({
/**
Expand Down Expand Up @@ -228,7 +228,9 @@ const BaseConfigSchema = z.object({
* Browser to use: chromium, firefox, or webkit
* @default 'chromium'
*/
browser: z.enum(['chromium', 'firefox', 'webkit']).default('chromium'),
browser: z
.union([BrowserSchema, z.array(BrowserSchema).default(['chromium'])])
.default('chromium'),

/**
* Enable Storybook mode
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import z from 'zod';
import type { BrowserContextOptions } from 'playwright-core';

export const BrowserSchema = z.enum(['chromium', 'firefox', 'webkit']);

export const ShotModeSchema = z.enum([
'storybook',
'ladle',
Expand Down

0 comments on commit 1c62ff2

Please sign in to comment.