test: use TestOptions type in config (#326)

This commit is contained in:
Max Schmitt
2025-05-02 13:50:03 +02:00
committed by GitHub
parent a15f0f301b
commit a713300c5b
4 changed files with 11 additions and 7 deletions

View File

@@ -16,7 +16,7 @@
import { test, expect } from './fixtures.js';
test('browser_take_screenshot (viewport)', async ({ startClient, server }) => {
test('--device should work', async ({ startClient, server }) => {
const client = await startClient({
args: ['--device', 'iPhone 15'],
});

View File

@@ -27,6 +27,10 @@ import { TestServer } from './testserver/index.ts';
import type { Config } from '../config';
export type TestOptions = {
mcpBrowser: string | undefined;
};
type TestFixtures = {
client: Client;
visionClient: Client;
@@ -36,14 +40,13 @@ type TestFixtures = {
server: TestServer;
httpsServer: TestServer;
mcpHeadless: boolean;
mcpBrowser: string | undefined;
};
type WorkerFixtures = {
_workerServers: { server: TestServer, httpsServer: TestServer };
};
export const test = baseTest.extend<TestFixtures, WorkerFixtures>({
export const test = baseTest.extend<TestFixtures & TestOptions, WorkerFixtures>({
client: async ({ startClient }, use) => {
await use(await startClient());