Skip to content

Commit 4d5a62a

Browse files
committed
refactor: address pr comments
1 parent 417cdf5 commit 4d5a62a

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

tests/tools/extensions.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import {
1919
triggerExtensionAction,
2020
} from '../../src/tools/extensions.js';
2121
import {listPages} from '../../src/tools/pages.js';
22-
import {extractId, withMcpContext} from '../utils.js';
22+
import {extractExtensionId, withMcpContext} from '../utils.js';
2323

2424
const EXTENSION_WITH_SW_PATH = path.join(
2525
import.meta.dirname,
@@ -44,7 +44,7 @@ describe('extension', () => {
4444
context,
4545
);
4646

47-
const extensionId = extractId(response);
47+
const extensionId = extractExtensionId(response);
4848
const page = context.getSelectedPptrPage();
4949
await page.goto('chrome://extensions');
5050

@@ -99,7 +99,7 @@ describe('extension', () => {
9999
context,
100100
);
101101

102-
const extensionId = extractId(response);
102+
const extensionId = extractExtensionId(response);
103103
const installSpy = sinon.spy(context, 'installExtension');
104104
response.resetResponseLineForTesting();
105105

@@ -132,7 +132,6 @@ describe('extension', () => {
132132
EXTENSION_WITH_SW_PATH,
133133
);
134134

135-
response.resetResponseLineForTesting();
136135
const listPageDef = listPages({
137136
categoryExtensions: true,
138137
} as ParsedArguments);

tests/tools/script.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import type {ParsedArguments} from '../../src/cli.js';
1212
import {installExtension} from '../../src/tools/extensions.js';
1313
import {evaluateScript} from '../../src/tools/script.js';
1414
import {serverHooks} from '../server.js';
15-
import {extractId, html, withMcpContext} from '../utils.js';
15+
import {extractExtensionId, html, withMcpContext} from '../utils.js';
1616

1717
const EXTENSION_PATH = path.join(
1818
import.meta.dirname,
@@ -207,7 +207,7 @@ describe('script', () => {
207207
context,
208208
);
209209

210-
const extensionId = extractId(response);
210+
const extensionId = extractExtensionId(response);
211211
const swTarget = await context.browser.waitForTarget(
212212
t => t.type() === 'service_worker' && t.url().includes(extensionId),
213213
);

tests/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export function getImageContent(content: CallToolResult['content'][number]): {
4444
throw new Error(`Expected image content but got ${content.type}`);
4545
}
4646

47-
export function extractId(response: McpResponse) {
47+
export function extractExtensionId(response: McpResponse) {
4848
const responseLine = response.responseLines[0];
4949
assert.ok(responseLine, 'Response should not be empty');
5050
const match = responseLine.match(/Extension installed\. Id: (.+)/);
@@ -101,7 +101,6 @@ export async function withMcpContext(
101101
debug?: boolean;
102102
autoOpenDevTools?: boolean;
103103
performanceCrux?: boolean;
104-
channel?: string;
105104
executablePath?: string;
106105
} = {},
107106
args: ParsedArguments = {} as ParsedArguments,

0 commit comments

Comments
 (0)