Skip to content

Commit b89a238

Browse files
committed
chore: spawn new browser flag
1 parent 3d6d4a5 commit b89a238

2 files changed

Lines changed: 4 additions & 5 deletions

File tree

tests/tools/pages.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ describe('pages', () => {
198198
await context.uninstallExtension(extensionId);
199199
},
200200
{
201-
userDataDir: '/tmp/chrome-test',
201+
spawnNewBrowser: true,
202202
},
203203
{
204204
categoryExtensions: true,

tests/utils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function withBrowser(
6262
debug?: boolean;
6363
autoOpenDevTools?: boolean;
6464
executablePath?: string;
65-
userDataDir?: string;
65+
spawnNewBrowser?: boolean;
6666
} = {},
6767
) {
6868
const launchOptions: LaunchOptions = {
@@ -75,11 +75,10 @@ export async function withBrowser(
7575
handleDevToolsAsPage: true,
7676
args: ['--screen-info={3840x2160}'],
7777
enableExtensions: true,
78-
userDataDir: options.userDataDir,
7978
};
8079
const key = JSON.stringify(launchOptions);
8180

82-
let browser = browsers.get(key);
81+
let browser = options.spawnNewBrowser && browsers.get(key);
8382
if (!browser) {
8483
browser = await puppeteer.launch(launchOptions);
8584
browsers.set(key, browser);
@@ -104,7 +103,7 @@ export async function withMcpContext(
104103
autoOpenDevTools?: boolean;
105104
performanceCrux?: boolean;
106105
executablePath?: string;
107-
userDataDir?: string;
106+
spawnNewBrowser?: boolean;
108107
} = {},
109108
args: ParsedArguments = {} as ParsedArguments,
110109
) {

0 commit comments

Comments
 (0)