@@ -19,6 +19,7 @@ describe('MongoshLoggingAndTelemetry', function () {
19
19
20
20
const userId = '53defe995fa47e6c13102d9d' ;
21
21
const logId = '5fb3c20ee1507e894e5340f3' ;
22
+ const deviceId = 'test-device' ;
22
23
23
24
let logger : MongoLogWriter ;
24
25
@@ -39,7 +40,6 @@ describe('MongoshLoggingAndTelemetry', function () {
39
40
const testLoggingArguments : Omit < MongoshLoggingAndTelemetryArguments , 'bus' > =
40
41
{
41
42
analytics,
42
- deviceId : 'test-device' ,
43
43
userTraits : {
44
44
platform : process . platform ,
45
45
arch : process . arch ,
@@ -54,6 +54,7 @@ describe('MongoshLoggingAndTelemetry', function () {
54
54
55
55
loggingAndTelemetry = setupLoggingAndTelemetry ( {
56
56
...testLoggingArguments ,
57
+ deviceId,
57
58
bus,
58
59
} ) ;
59
60
@@ -117,8 +118,8 @@ describe('MongoshLoggingAndTelemetry', function () {
117
118
'identify' ,
118
119
{
119
120
anonymousId : userId ,
120
- deviceId : 'test-device' ,
121
121
traits : {
122
+ device_id : deviceId ,
122
123
arch : process . arch ,
123
124
platform : process . platform ,
124
125
session_id : logId ,
@@ -129,7 +130,6 @@ describe('MongoshLoggingAndTelemetry', function () {
129
130
'track' ,
130
131
{
131
132
anonymousId : userId ,
132
- deviceId : 'test-device' ,
133
133
event : 'New Connection' ,
134
134
properties : {
135
135
mongosh_version : '1.0.0' ,
@@ -178,8 +178,8 @@ describe('MongoshLoggingAndTelemetry', function () {
178
178
'identify' ,
179
179
{
180
180
anonymousId : userId ,
181
- deviceId : 'test-device' ,
182
181
traits : {
182
+ device_id : deviceId ,
183
183
arch : process . arch ,
184
184
platform : process . platform ,
185
185
session_id : logId ,
@@ -190,7 +190,6 @@ describe('MongoshLoggingAndTelemetry', function () {
190
190
'track' ,
191
191
{
192
192
anonymousId : userId ,
193
- deviceId : 'test-device' ,
194
193
event : 'New Connection' ,
195
194
properties : {
196
195
mongosh_version : '1.0.0' ,
@@ -235,9 +234,9 @@ describe('MongoshLoggingAndTelemetry', function () {
235
234
[
236
235
'identify' ,
237
236
{
238
- deviceId : 'unknown' ,
239
237
anonymousId : userId ,
240
238
traits : {
239
+ device_id : 'unknown' ,
241
240
platform : process . platform ,
242
241
arch : process . arch ,
243
242
session_id : logId ,
@@ -272,9 +271,9 @@ describe('MongoshLoggingAndTelemetry', function () {
272
271
[
273
272
'identify' ,
274
273
{
275
- deviceId,
276
274
anonymousId : userId ,
277
275
traits : {
276
+ device_id : deviceId ,
278
277
platform : process . platform ,
279
278
arch : process . arch ,
280
279
session_id : logId ,
@@ -299,7 +298,7 @@ describe('MongoshLoggingAndTelemetry', function () {
299
298
...testLoggingArguments ,
300
299
bus,
301
300
deviceId : undefined ,
302
- } ) ;
301
+ } ) as LoggingAndTelemetry ;
303
302
304
303
loggingAndTelemetry . attachLogger ( logger ) ;
305
304
@@ -310,13 +309,13 @@ describe('MongoshLoggingAndTelemetry', function () {
310
309
expect ( analyticsOutput ) . to . have . lengthOf ( 0 ) ;
311
310
312
311
resolveTelemetry ( '1234' ) ;
313
- await ( loggingAndTelemetry as LoggingAndTelemetry ) . setupTelemetryPromise ;
312
+ await loggingAndTelemetry . setupTelemetryPromise ;
314
313
315
314
expect ( logOutput ) . to . have . lengthOf ( 1 ) ;
316
315
expect ( analyticsOutput ) . to . have . lengthOf ( 1 ) ;
317
316
318
317
// Hash created from machine ID 1234
319
- expect ( analyticsOutput [ 0 ] [ 1 ] . deviceId ) . equals (
318
+ expect ( loggingAndTelemetry [ ' deviceId' ] ) . equals (
320
319
'8c9f929608f0ef13bfd5a290e0233f283e2cc25ffefc2ad8d9ef0650eb224a52'
321
320
) ;
322
321
} ) ;
@@ -719,8 +718,8 @@ describe('MongoshLoggingAndTelemetry', function () {
719
718
'identify' ,
720
719
{
721
720
anonymousId : userId ,
722
- deviceId : 'test-device' ,
723
721
traits : {
722
+ device_id : deviceId ,
724
723
platform : process . platform ,
725
724
arch : process . arch ,
726
725
session_id : logId ,
@@ -731,8 +730,8 @@ describe('MongoshLoggingAndTelemetry', function () {
731
730
'identify' ,
732
731
{
733
732
anonymousId : userId ,
734
- deviceId : 'test-device' ,
735
733
traits : {
734
+ device_id : deviceId ,
736
735
platform : process . platform ,
737
736
arch : process . arch ,
738
737
session_id : logId ,
@@ -743,7 +742,6 @@ describe('MongoshLoggingAndTelemetry', function () {
743
742
'track' ,
744
743
{
745
744
anonymousId : userId ,
746
- deviceId : 'test-device' ,
747
745
event : 'Startup Time' ,
748
746
properties : {
749
747
is_interactive : true ,
@@ -759,7 +757,6 @@ describe('MongoshLoggingAndTelemetry', function () {
759
757
'track' ,
760
758
{
761
759
anonymousId : '53defe995fa47e6c13102d9d' ,
762
- deviceId : 'test-device' ,
763
760
event : 'Error' ,
764
761
properties : {
765
762
mongosh_version : '1.0.0' ,
@@ -775,7 +772,6 @@ describe('MongoshLoggingAndTelemetry', function () {
775
772
'track' ,
776
773
{
777
774
anonymousId : '53defe995fa47e6c13102d9d' ,
778
- deviceId : 'test-device' ,
779
775
event : 'Error' ,
780
776
properties : {
781
777
mongosh_version : '1.0.0' ,
@@ -791,7 +787,6 @@ describe('MongoshLoggingAndTelemetry', function () {
791
787
'track' ,
792
788
{
793
789
anonymousId : '53defe995fa47e6c13102d9d' ,
794
- deviceId : 'test-device' ,
795
790
event : 'Use' ,
796
791
properties : {
797
792
mongosh_version : '1.0.0' ,
@@ -803,7 +798,6 @@ describe('MongoshLoggingAndTelemetry', function () {
803
798
'track' ,
804
799
{
805
800
anonymousId : '53defe995fa47e6c13102d9d' ,
806
- deviceId : 'test-device' ,
807
801
event : 'Show' ,
808
802
properties : {
809
803
mongosh_version : '1.0.0' ,
@@ -823,7 +817,6 @@ describe('MongoshLoggingAndTelemetry', function () {
823
817
shell : true ,
824
818
} ,
825
819
anonymousId : '53defe995fa47e6c13102d9d' ,
826
- deviceId : 'test-device' ,
827
820
} ,
828
821
] ,
829
822
[
@@ -836,7 +829,6 @@ describe('MongoshLoggingAndTelemetry', function () {
836
829
nested : false ,
837
830
} ,
838
831
anonymousId : '53defe995fa47e6c13102d9d' ,
839
- deviceId : 'test-device' ,
840
832
} ,
841
833
] ,
842
834
[
@@ -848,7 +840,6 @@ describe('MongoshLoggingAndTelemetry', function () {
848
840
session_id : logId ,
849
841
} ,
850
842
anonymousId : '53defe995fa47e6c13102d9d' ,
851
- deviceId : 'test-device' ,
852
843
} ,
853
844
] ,
854
845
[
@@ -860,7 +851,6 @@ describe('MongoshLoggingAndTelemetry', function () {
860
851
session_id : logId ,
861
852
} ,
862
853
anonymousId : '53defe995fa47e6c13102d9d' ,
863
- deviceId : 'test-device' ,
864
854
} ,
865
855
] ,
866
856
[
@@ -873,14 +863,12 @@ describe('MongoshLoggingAndTelemetry', function () {
873
863
shell : true ,
874
864
} ,
875
865
anonymousId : '53defe995fa47e6c13102d9d' ,
876
- deviceId : 'test-device' ,
877
866
} ,
878
867
] ,
879
868
[
880
869
'track' ,
881
870
{
882
871
anonymousId : '53defe995fa47e6c13102d9d' ,
883
- deviceId : 'test-device' ,
884
872
event : 'Snippet Install' ,
885
873
properties : {
886
874
mongosh_version : '1.0.0' ,
@@ -976,7 +964,6 @@ describe('MongoshLoggingAndTelemetry', function () {
976
964
'track' ,
977
965
{
978
966
anonymousId : '53defe995fa47e6c13102d9d' ,
979
- deviceId : 'test-device' ,
980
967
event : 'Deprecated Method' ,
981
968
properties : {
982
969
mongosh_version : '1.0.0' ,
@@ -990,7 +977,6 @@ describe('MongoshLoggingAndTelemetry', function () {
990
977
'track' ,
991
978
{
992
979
anonymousId : '53defe995fa47e6c13102d9d' ,
993
- deviceId : 'test-device' ,
994
980
event : 'Deprecated Method' ,
995
981
properties : {
996
982
mongosh_version : '1.0.0' ,
@@ -1004,7 +990,6 @@ describe('MongoshLoggingAndTelemetry', function () {
1004
990
'track' ,
1005
991
{
1006
992
anonymousId : '53defe995fa47e6c13102d9d' ,
1007
- deviceId : 'test-device' ,
1008
993
event : 'Deprecated Method' ,
1009
994
properties : {
1010
995
mongosh_version : '1.0.0' ,
@@ -1018,7 +1003,6 @@ describe('MongoshLoggingAndTelemetry', function () {
1018
1003
'track' ,
1019
1004
{
1020
1005
anonymousId : '53defe995fa47e6c13102d9d' ,
1021
- deviceId : 'test-device' ,
1022
1006
event : 'API Call' ,
1023
1007
properties : {
1024
1008
mongosh_version : '1.0.0' ,
@@ -1033,7 +1017,6 @@ describe('MongoshLoggingAndTelemetry', function () {
1033
1017
'track' ,
1034
1018
{
1035
1019
anonymousId : '53defe995fa47e6c13102d9d' ,
1036
- deviceId : 'test-device' ,
1037
1020
event : 'API Call' ,
1038
1021
properties : {
1039
1022
mongosh_version : '1.0.0' ,
@@ -1188,7 +1171,6 @@ describe('MongoshLoggingAndTelemetry', function () {
1188
1171
'track' ,
1189
1172
{
1190
1173
anonymousId : undefined ,
1191
- deviceId : 'test-device' ,
1192
1174
event : 'New Connection' ,
1193
1175
properties : {
1194
1176
mongosh_version : '1.0.0' ,
0 commit comments