Skip to content

Commit 03ebc05

Browse files
committed
Modified TC to mock trackMCPEvent
1 parent 92100d4 commit 03ebc05

File tree

6 files changed

+17
-1
lines changed

6 files changed

+17
-1
lines changed

src/tools/accessibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function addAccessibilityTools(server: McpServer) {
5656
pageURL: z.string().describe("The URL to scan for accessibility issues"),
5757
},
5858
async (args) => {
59-
trackMCPEvent("startAccessibilityScan")
59+
trackMCPEvent("startAccessibilityScan");
6060
return runAccessibilityScan(args.name, args.pageURL);
6161
},
6262
);

tests/tools/applive.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ jest.mock('../../src/tools/applive-utils/start-session', () => ({
1515
jest.mock('../../src/logger', () => ({
1616
error: jest.fn()
1717
}));
18+
jest.mock('../../src/lib/instrumentation', () => ({
19+
trackMCPEvent: jest.fn()
20+
}));
1821

1922
describe('startAppLiveSession', () => {
2023
beforeEach(() => {

tests/tools/automate.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import { retrieveNetworkFailures } from '../../src/lib/api';
44
jest.mock('../../src/lib/api', () => ({
55
retrieveNetworkFailures: jest.fn()
66
}));
7+
jest.mock('../../src/lib/instrumentation', () => ({
8+
trackMCPEvent: jest.fn()
9+
}));
710
jest.mock('../../src/logger', () => ({
811
error: jest.fn(),
912
info: jest.fn()

tests/tools/live.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jest.mock('../../src/lib/local', () => ({
1313
jest.mock('../../src/logger', () => ({
1414
error: jest.fn()
1515
}));
16+
jest.mock('../../src/lib/instrumentation', () => ({
17+
trackMCPEvent: jest.fn()
18+
}));
1619

1720
describe('startBrowserLiveSession', () => {
1821
let serverMock: any;

tests/tools/observability.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ jest.mock('../../src/lib/api', () => ({
66
getLatestO11YBuildInfo: jest.fn(),
77
}));
88

9+
jest.mock('../../src/lib/instrumentation', () => ({
10+
trackMCPEvent: jest.fn()
11+
}));
12+
913
describe('getFailuresInLastRun', () => {
1014
beforeEach(() => {
1115
jest.clearAllMocks();

tests/tools/testmanagement.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jest.mock('../../src/config', () => ({
2222
browserstackAccessKey: 'fake-key',
2323
},
2424
}));
25+
jest.mock('../../src/lib/instrumentation', () => ({
26+
trackMCPEvent: jest.fn(),
27+
}));
2528

2629
describe('createTestCaseTool', () => {
2730
beforeEach(() => {

0 commit comments

Comments
 (0)