Skip to content

Commit 2bb8730

Browse files
committed
fix: import the library in tests
1 parent eb5e073 commit 2bb8730

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

packages/logging/src/logging-and-telemetry.spec.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import type { Writable } from 'stream';
88
import type { MongoshLoggingAndTelemetry } from '.';
99
import { setupLoggingAndTelemetry } from '.';
1010
import type { LoggingAndTelemetry } from './logging-and-telemetry';
11-
import { getDeviceId } from './logging-and-telemetry';
1211
import sinon from 'sinon';
1312
import type { MongoshLoggingAndTelemetryArguments } from './types';
13+
import { getDeviceId } from '@mongodb-js/device-id';
14+
import { getMachineId } from 'native-machine-id';
1415

1516
describe('MongoshLoggingAndTelemetry', function () {
1617
let logOutput: any[];
@@ -264,7 +265,10 @@ describe('MongoshLoggingAndTelemetry', function () {
264265

265266
bus.emit('mongosh:new-user', { userId, anonymousId: userId });
266267

267-
const deviceId = await getDeviceId();
268+
const deviceId = await getDeviceId({
269+
getMachineId: () => getMachineId({ raw: true }),
270+
isNodeMachineId: false,
271+
}).value;
268272

269273
await (loggingAndTelemetry as LoggingAndTelemetry).setupTelemetryPromise;
270274

@@ -1202,13 +1206,4 @@ describe('MongoshLoggingAndTelemetry', function () {
12021206
],
12031207
]);
12041208
});
1205-
1206-
describe('getDeviceId()', function () {
1207-
it('is consistent on the same machine', async function () {
1208-
const idA = await getDeviceId();
1209-
const idB = await getDeviceId();
1210-
1211-
expect(idA).equals(idB);
1212-
});
1213-
});
12141209
});

0 commit comments

Comments
 (0)