Skip to content

Commit

Permalink
fix: exclude tracesDir option from launchOptions fixture (#24086)
Browse files Browse the repository at this point in the history
Fixes #23645
  • Loading branch information
aslushnikov authored Jul 6, 2023
1 parent 3536e81 commit 9af2b51
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/playwright-test/types/test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3530,7 +3530,7 @@ export interface PlaywrightWorkerOptions {
* ```
*
*/
launchOptions: LaunchOptions;
launchOptions: Omit<LaunchOptions, 'tracesDir'>;
/**
* **Usage**
*
Expand Down
17 changes: 17 additions & 0 deletions tests/playwright-test/config.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,3 +480,20 @@ test('should have correct types for the config', async ({ runTSC }) => {
});
expect(result.exitCode).toBe(0);
});

test('should not allow tracesDir in launchOptions', async ({ runTSC }) => {
const result = await runTSC({
'playwright.config.ts': `
import { defineConfig } from '@playwright/test';
export default defineConfig({
use: {
launchOptions: {
tracesDir: 'foo',
},
},
});
`
});
expect(result.exitCode).not.toBe(0);
});
2 changes: 1 addition & 1 deletion utils/generate_types/overrides-test.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ export interface PlaywrightWorkerOptions {
defaultBrowserType: BrowserName;
headless: boolean;
channel: BrowserChannel | undefined;
launchOptions: LaunchOptions;
launchOptions: Omit<LaunchOptions, 'tracesDir'>;
connectOptions: ConnectOptions | undefined;
screenshot: ScreenshotMode | { mode: ScreenshotMode } & Pick<PageScreenshotOptions, 'fullPage' | 'omitBackground'>;
trace: TraceMode | /** deprecated */ 'retry-with-trace' | { mode: TraceMode, snapshots?: boolean, screenshots?: boolean, sources?: boolean, attachments?: boolean };
Expand Down

0 comments on commit 9af2b51

Please sign in to comment.