Skip to content

Commit 5fb0284

Browse files
committed
chore: lint and test fix
1 parent bb97041 commit 5fb0284

File tree

5 files changed

+8
-5
lines changed

5 files changed

+8
-5
lines changed

tests/integration/tools/atlas/atlasHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export function describeWithAtlas(name: string, fn: IntegrationTestFunction): Su
1515
}));
1616

1717
describe(name, () => {
18-
fn(integration);
18+
fn(clea);
1919
});
2020
};
2121

tests/integration/transports/stdio.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { describe, expect, it, beforeAll, afterAll } from "vitest";
22
import { StdioClientTransport } from "@modelcontextprotocol/sdk/client/stdio.js";
33
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
44
import { describeWithMongoDB } from "../tools/mongodb/mongodbHelpers.js";
5+
import { DeviceIdService } from "../../../src/helpers/deviceId.js";
6+
import { CompositeLogger } from "../../../src/common/logger.js";
57

68
describeWithMongoDB("StdioRunner", (integration) => {
79
describe("client connects successfully", () => {
@@ -20,6 +22,7 @@ describeWithMongoDB("StdioRunner", (integration) => {
2022
name: "test",
2123
version: "0.0.0",
2224
});
25+
DeviceIdService.init(new CompositeLogger());
2326
await client.connect(transport);
2427
});
2528

tests/integration/transports/streamableHttp.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Client } from "@modelcontextprotocol/sdk/client/index.js";
33
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js";
44
import { describe, expect, it, beforeAll, afterAll } from "vitest";
55
import { config } from "../../../src/common/config.js";
6+
import { DeviceIdService } from "../../../src/helpers/deviceId.js";
67

78
describe("StreamableHttpRunner", () => {
89
let runner: StreamableHttpRunner;
@@ -15,6 +16,7 @@ describe("StreamableHttpRunner", () => {
1516
config.telemetry = "disabled";
1617
config.loggers = ["stderr"];
1718
runner = new StreamableHttpRunner(config);
19+
DeviceIdService.init(runner.logger);
1820
await runner.start();
1921
});
2022

tests/unit/helpers/deviceId.test.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
21
import { describe, expect, it, vi, beforeEach, afterEach } from "vitest";
32
import { DeviceIdService } from "../../../src/helpers/deviceId.js";
43
import { getDeviceId } from "@mongodb-js/device-id";
@@ -184,9 +183,6 @@ describe("Device ID Helper", () => {
184183
});
185184

186185
it("should handle machine ID generation failure", async () => {
187-
// Mock getMachineId to throw an error
188-
mockGetMachineId = vi.fn().mockRejectedValue(new Error("Machine ID generation failed"));
189-
190186
MockGetDeviceId.mockRejectedValue(new Error("Device ID failed"));
191187

192188
// Initialize after mocking

tests/unit/resources/common/debug.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { config } from "../../../../src/common/config.js";
66
import { CompositeLogger } from "../../../../src/common/logger.js";
77
import { ConnectionManager } from "../../../../src/common/connectionManager.js";
88
import { ExportsManager } from "../../../../src/common/exportsManager.js";
9+
import { DeviceIdService } from "../../../../src/helpers/deviceId.js";
910

1011
describe("debug resource", () => {
1112
const logger = new CompositeLogger();
@@ -21,6 +22,7 @@ describe("debug resource", () => {
2122

2223
beforeEach(() => {
2324
debugResource = new DebugResource(session, config, telemetry);
25+
DeviceIdService.init(logger);
2426
});
2527

2628
it("should be connected when a connected event happens", () => {

0 commit comments

Comments
 (0)