@@ -8,9 +8,10 @@ import type { Writable } from 'stream';
88import type { MongoshLoggingAndTelemetry } from '.' ;
99import { setupLoggingAndTelemetry } from '.' ;
1010import type { LoggingAndTelemetry } from './logging-and-telemetry' ;
11- import { getDeviceId } from './logging-and-telemetry' ;
1211import sinon from 'sinon' ;
1312import type { MongoshLoggingAndTelemetryArguments } from './types' ;
13+ import { getDeviceId } from '@mongodb-js/device-id' ;
14+ import { getMachineId } from 'native-machine-id' ;
1415
1516describe ( '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