Skip to content

Commit 2b085ce

Browse files
manoj-k04claude
andcommitted
fix(percy): drop runPercyScan config parameter
config was only used to derive auth for the now-removed fetchPercyToken call. Drop the dead parameter from the signature and update the lone caller in percy-sdk.ts. Resolves the eslint no-unused-vars error introduced by the prior commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 7bc7546 commit 2b085ce

4 files changed

Lines changed: 20 additions & 40 deletions

File tree

src/tools/percy-sdk.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export function registerPercyTools(
140140
async (args) => {
141141
try {
142142
trackMCP("runPercyScan", server.server.getClientVersion()!, config);
143-
return runPercyScan(args, config);
143+
return runPercyScan(args);
144144
} catch (error) {
145145
return handleMCPError("runPercyScan", server, config, error);
146146
}

src/tools/run-percy-scan.ts

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
import { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
22
import { PercyIntegrationTypeEnum } from "./sdk-utils/common/types.js";
3-
import { BrowserStackConfig } from "../lib/types.js";
43
import { storedPercyResults } from "../lib/inmemory-store.js";
54
import {
65
getFrameworkTestCommand,
76
PERCY_FALLBACK_STEPS,
87
} from "./sdk-utils/percy-web/constants.js";
98
import path from "path";
109

11-
export async function runPercyScan(
12-
args: {
13-
projectName: string;
14-
integrationType: PercyIntegrationTypeEnum;
15-
instruction?: string;
16-
},
17-
_config: BrowserStackConfig,
18-
): Promise<CallToolResult> {
10+
export async function runPercyScan(args: {
11+
projectName: string;
12+
integrationType: PercyIntegrationTypeEnum;
13+
instruction?: string;
14+
}): Promise<CallToolResult> {
1915
const { projectName, instruction } = args;
2016

2117
// Check if we have stored data and project matches

src/tools/sdk-utils/percy-web/handler.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,7 @@ import {
1010

1111
export let percyWebSetupInstructions = "";
1212

13-
export function runPercyWeb(
14-
input: SetUpPercyInput,
15-
): RunTestsInstructionResult {
13+
export function runPercyWeb(input: SetUpPercyInput): RunTestsInstructionResult {
1614
const steps: RunTestsStep[] = [];
1715

1816
// Assume configuration is supported due to guardrails at orchestration layer

tests/tools/runPercyScan.test.ts

Lines changed: 13 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,16 @@ vi.mock("../../src/logger", () => ({
1414
default: { error: vi.fn(), info: vi.fn(), debug: vi.fn() },
1515
}));
1616

17-
const mockConfig = {
18-
"browserstack-username": "fake-user",
19-
"browserstack-access-key": "fake-key",
20-
};
21-
2217
describe("runPercyScan", () => {
2318
beforeEach(() => vi.clearAllMocks());
2419

2520
it("renders PERCY_TOKEN setup instructions with placeholder", async () => {
2621
(storedPercyResults.get as Mock).mockReturnValue(null);
2722

28-
const result = await runPercyScan(
29-
{
30-
projectName: "my-project",
31-
integrationType: PercyIntegrationTypeEnum.WEB,
32-
},
33-
mockConfig,
34-
);
23+
const result = await runPercyScan({
24+
projectName: "my-project",
25+
integrationType: PercyIntegrationTypeEnum.WEB,
26+
});
3527

3628
const text = result.content[0].text as string;
3729
expect(text).toContain("PERCY_TOKEN");
@@ -47,13 +39,10 @@ describe("runPercyScan", () => {
4739
detectedTestingFramework: "jest",
4840
});
4941

50-
const result = await runPercyScan(
51-
{
52-
projectName: "my-project",
53-
integrationType: PercyIntegrationTypeEnum.WEB,
54-
},
55-
mockConfig,
56-
);
42+
const result = await runPercyScan({
43+
projectName: "my-project",
44+
integrationType: PercyIntegrationTypeEnum.WEB,
45+
});
5746

5847
const text = result.content[0].text as string;
5948
expect(text).toContain("Updated files to run");
@@ -62,14 +51,11 @@ describe("runPercyScan", () => {
6251
it("includes custom instruction steps", async () => {
6352
(storedPercyResults.get as Mock).mockReturnValue(null);
6453

65-
const result = await runPercyScan(
66-
{
67-
projectName: "my-project",
68-
integrationType: PercyIntegrationTypeEnum.WEB,
69-
instruction: "npx percy exec -- npx playwright test",
70-
},
71-
mockConfig,
72-
);
54+
const result = await runPercyScan({
55+
projectName: "my-project",
56+
integrationType: PercyIntegrationTypeEnum.WEB,
57+
instruction: "npx percy exec -- npx playwright test",
58+
});
7359

7460
const text = result.content[0].text as string;
7561
expect(text).toContain("npx percy exec");

0 commit comments

Comments
 (0)