-
-
Notifications
You must be signed in to change notification settings - Fork 197
/
Copy pathdevice-log-provider.ts
1501 lines (1436 loc) · 86 KB
/
device-log-provider.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Integration tests between $logFilter ($androidLogFilter and $iOSLogFilter) and $logSourceMapService
// These tests ensure device log is correctly parsed by CLI, i.e. the input is the exact output from device/emulator/simulator
// The output is what CLI will show.
import { Yok } from "../../../yok";
import { LogFilter } from "../../../mobile/log-filter";
import { AndroidLogFilter } from "../../../mobile/android/android-log-filter";
import { IOSLogFilter } from "../../../../services/ios-log-filter";
import { CommonLoggerStub } from "../stubs";
import { LogSourceMapService } from "../../../../services/log-source-map-service";
import { LoggingLevels } from "../../../mobile/logging-levels";
import { DevicePlatformsConstants } from "../../../mobile/device-platforms-constants";
import { DeviceLogProvider } from "../../../mobile/device-log-provider";
import { assert } from "chai";
import * as util from "util";
import * as path from "path";
import { FileSystem } from "../../../file-system";
const deviceIdentifier = "deviceIdentifier";
let runtimeVersion = "6.1.0";
let platform: string;
const createTestInjector = (): IInjector => {
const testInjector: IInjector = new Yok();
testInjector.register("logFilter", LogFilter);
testInjector.register("androidLogFilter", AndroidLogFilter);
testInjector.register("iOSLogFilter", IOSLogFilter);
testInjector.register("logger", CommonLoggerStub);
testInjector.register("logSourceMapService", LogSourceMapService);
testInjector.register("loggingLevels", LoggingLevels);
testInjector.register("devicePlatformsConstants", DevicePlatformsConstants);
testInjector.register("fs", FileSystem);
testInjector.register("projectDataService", {
getProjectData: (projectDir?: string): IProjectData => {
return <any>{
getAppDirectoryRelativePath: () => {
return "app";
},
projectIdentifiers: {
android: "org.nativescript.appTestLogs",
ios: "org.nativescript.appTestLogs"
},
projectDir: "projectDir"
};
},
getNSValue: (projectDir: string, propertyName: string): any => {
return {
version: runtimeVersion
};
}
});
testInjector.register("deviceLogProvider", DeviceLogProvider);
testInjector.register("platformsDataService", {
getPlatformData: (pl: string) => {
return {
appDestinationDirectoryPath: path.join(__dirname, "..", "..", "resources", "device-log-provider-integration-tests", pl.toLowerCase()),
frameworkPackageName: `tns-${platform.toLowerCase()}`
};
}
});
const logger = testInjector.resolve<CommonLoggerStub>("logger");
logger.info = (...args: any[]): void => {
args = args.filter(arg => Object.keys(arg).indexOf("skipNewLine") === -1);
logger.output += util.format.apply(null, args.filter(_.isString));
};
return testInjector;
};
describe("deviceLogProvider", () => {
let testInjector: IInjector;
let logger: CommonLoggerStub;
let deviceLogProvider: Mobile.IDeviceLogProvider;
const assertData = (actual: string, expected: string) => {
const actualFixed = actual.replace(/\r\n/g, "\n").replace(/\\/g, "/");
const expectedFixed = expected.replace(/\r\n/g, "\n").replace(/\\/g, "/");
assert.equal(actualFixed, expectedFixed);
};
before(async () => {
testInjector = createTestInjector();
const fs = testInjector.resolve<IFileSystem>("fs");
const logSourceMapService = testInjector.resolve("logSourceMapService");
const originalFilesLocation = path.join(__dirname, "..", "..", "resources", "device-log-provider-integration-tests");
const files = fs.enumerateFilesInDirectorySync(originalFilesLocation);
for (const file of files) {
await logSourceMapService.setSourceMapConsumerForFile(file);
}
logger = testInjector.resolve<CommonLoggerStub>("logger");
deviceLogProvider = testInjector.resolve<Mobile.IDeviceLogProvider>("deviceLogProvider");
deviceLogProvider.setProjectDirForDevice("deviceIdentifier", "dir_with_runtime_6.1.0");
});
beforeEach(() => {
logger.output = "";
});
describe("integration tests", () => {
describe("android", () => {
const logDataForAndroid = (data: string): void => {
// That's the way data is passed to deviceLogProvider from logcatHelper
const lines = data.split("\n");
for (const line of lines) {
deviceLogProvider.logData(line, platform, deviceIdentifier);
}
};
before(() => {
platform = "android";
deviceLogProvider.setApplicationPidForDevice(deviceIdentifier, "25038");
});
describe("runtime version is below 6.1.0", () => {
before(() => {
runtimeVersion = "6.0.0";
deviceLogProvider.setProjectDirForDevice("deviceIdentifier", "dir_with_runtime_6.0.0");
});
describe("SDK 28", () => {
it("console.log", () => {
logDataForAndroid("08-22 15:31:53.189 25038 25038 I JS : HMR: Hot Module Replacement Enabled. Waiting for signal.");
assertData(logger.output, "JS: HMR: Hot Module Replacement Enabled. Waiting for signal.\n");
});
it("console.dir", () => {
logDataForAndroid(`08-22 15:32:03.145 25038 25038 I JS : ==== object dump start ====
08-22 15:32:03.145 25038 25038 I JS : level0_0: {
08-22 15:32:03.145 25038 25038 I JS : "level1_0": {
08-22 15:32:03.145 25038 25038 I JS : "level2": "value"
08-22 15:32:03.145 25038 25038 I JS : },
08-22 15:32:03.145 25038 25038 I JS : "level1_1": {
08-22 15:32:03.145 25038 25038 I JS : "level2": "value2"
08-22 15:32:03.145 25038 25038 I JS : }
08-22 15:32:03.145 25038 25038 I JS : }
08-22 15:32:03.145 25038 25038 I JS : level0_1: {
08-22 15:32:03.145 25038 25038 I JS : "level1_0": "value3"
08-22 15:32:03.145 25038 25038 I JS : }
08-22 15:32:03.145 25038 25038 I JS : ==== object dump end ====`);
assertData(logger.output, `JS: ==== object dump start ====
JS: level0_0: {
JS: "level1_0": {
JS: "level2": "value"
JS: },
JS: "level1_1": {
JS: "level2": "value2"
JS: }
JS: }
JS: level0_1: {
JS: "level1_0": "value3"
JS: }
JS: ==== object dump end ====\n`);
});
it("multiline console.log statement", () => {
logDataForAndroid(`08-22 15:32:03.145 25038 25038 I JS : multiline
08-22 15:32:03.145 25038 25038 I JS : message
08-22 15:32:03.145 25038 25038 I JS : from
08-22 15:32:03.145 25038 25038 I JS : console.log`);
assertData(logger.output, `JS: multiline
JS: message
JS: from
JS: console.log\n`);
});
it("console.trace", async () => {
logDataForAndroid(`08-22 15:32:03.145 25038 25038 E JS : Trace: console.trace onTap
08-22 15:32:03.145 25038 25038 E JS : at viewModel.onTap (file:///data/data/org.nativescript.appTestLogs/files/app/bundle.js:297:17)
08-22 15:32:03.145 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3704:32)
08-22 15:32:03.145 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3724:18)
08-22 15:32:03.145 25038 25038 E JS : at ClickListenerImpl.onClick (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:14608:23)`);
assertData(logger.output, `JS: Trace: console.trace onTap
JS: at viewModel.onTap file: app/main-view-model.js:39:0
JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify file: node_modules/tns-core-modules/data/observable/observable.js:107:0
JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit file: node_modules/tns-core-modules/data/observable/observable.js:127:0
JS: at ClickListenerImpl.onClick file: node_modules/tns-core-modules/ui/button/button.js:29:0\n`);
});
it("console.time(timeEnd) statement", () => {
logDataForAndroid("08-22 15:32:03.145 25038 25038 I JS : console.time: 9603.00ms");
assertData(logger.output, "JS: console.time: 9603.00ms\n");
});
it("when an error is thrown, correct callstack is printed", async () => {
logDataForAndroid(`08-22 15:32:03.171 25038 25038 D AndroidRuntime: Shutting down VM
08-22 15:32:03.184 25038 25038 E AndroidRuntime: FATAL EXCEPTION: main
08-22 15:32:03.184 25038 25038 E AndroidRuntime: Process: org.nativescript.appTestLogs, PID: 25038
08-22 15:32:03.184 25038 25038 E AndroidRuntime: com.tns.NativeScriptException: Calling js method onClick failed
08-22 15:32:03.184 25038 25038 E AndroidRuntime: Error: Error in onTap
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1109)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1089)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1081)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.view.View.performClick(View.java:6597)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.view.View.performClickInternal(View.java:6574)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.view.View.access$3100(View.java:778)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:25885)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-22 15:32:03.184 25038 25038 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-22 15:32:03.210 25038 25038 W System.err: An uncaught Exception occurred on "main" thread.
08-22 15:32:03.210 25038 25038 W System.err: Calling js method onClick failed
08-22 15:32:03.210 25038 25038 W System.err: Error: Error in onTap
08-22 15:32:03.210 25038 25038 W System.err: ` + `
08-22 15:32:03.210 25038 25038 W System.err: StackTrace:
08-22 15:32:03.210 25038 25038 W System.err: Frame: function:'viewModel.onTap', file:'file:///data/data/org.nativescript.appTestLogs/files/app/bundle.js', line: 301, column: 15
08-22 15:32:03.210 25038 25038 W System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js', line: 3704, column: 32
08-22 15:32:03.210 25038 25038 W System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit', file:'file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js', line: 3724, column: 18
08-22 15:32:03.210 25038 25038 W System.err: Frame: function:'ClickListenerImpl.onClick', file:'file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js', line: 14608, column: 23
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1109)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1089)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1081)
08-22 15:32:03.210 25038 25038 W System.err: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
08-22 15:32:03.210 25038 25038 W System.err: at android.view.View.performClick(View.java:6597)
08-22 15:32:03.210 25038 25038 W System.err: at android.view.View.performClickInternal(View.java:6574)
08-22 15:32:03.210 25038 25038 W System.err: at android.view.View.access$3100(View.java:778)
08-22 15:32:03.210 25038 25038 W System.err: at android.view.View$PerformClick.run(View.java:25885)
08-22 15:32:03.210 25038 25038 W System.err: at android.os.Handler.handleCallback(Handler.java:873)
08-22 15:32:03.210 25038 25038 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
08-22 15:32:03.210 25038 25038 W System.err: at android.os.Looper.loop(Looper.java:193)
08-22 15:32:03.211 25038 25038 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-22 15:32:03.211 25038 25038 W System.err: at java.lang.reflect.Method.invoke(Native Method)
08-22 15:32:03.211 25038 25038 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-22 15:32:03.211 25038 25038 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)`);
assertData(logger.output, `System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: Error: Error in onTap
System.err: ` + `
System.err: StackTrace:
System.err: Frame: function:'viewModel.onTap', file:'file: app/main-view-model.js:43:0
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify', file:'file: node_modules/tns-core-modules/data/observable/observable.js:107:0
System.err: Frame: function:'push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit', file:'file: node_modules/tns-core-modules/data/observable/observable.js:127:0
System.err: Frame: function:'ClickListenerImpl.onClick', file:'file: node_modules/tns-core-modules/ui/button/button.js:29:0
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1242)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1122)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1109)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1089)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1081)
System.err: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
System.err: at android.view.View.performClick(View.java:6597)
System.err: at android.view.View.performClickInternal(View.java:6574)
System.err: at android.view.View.access$3100(View.java:778)
System.err: at android.view.View$PerformClick.run(View.java:25885)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:193)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\n`);
});
});
});
describe("runtime version is 6.1.0 or later", () => {
before(() => {
runtimeVersion = "6.1.0";
deviceLogProvider.setProjectDirForDevice("deviceIdentifier", "dir_with_runtime_6.1.0");
});
describe("SDK 28", () => {
it("console.log", () => {
logDataForAndroid("08-23 16:15:55.254 25038 25038 I JS : HMR: Hot Module Replacement Enabled. Waiting for signal.");
assertData(logger.output, "JS: HMR: Hot Module Replacement Enabled. Waiting for signal.\n");
});
it("console.dir", () => {
logDataForAndroid(`08-23 16:16:06.570 25038 25038 I JS : ==== object dump start ====
08-23 16:16:06.570 25038 25038 I JS : level0_0: {
08-23 16:16:06.570 25038 25038 I JS : "level1_0": {
08-23 16:16:06.570 25038 25038 I JS : "level2": "value"
08-23 16:16:06.570 25038 25038 I JS : },
08-23 16:16:06.570 25038 25038 I JS : "level1_1": {
08-23 16:16:06.570 25038 25038 I JS : "level2": "value2"
08-23 16:16:06.570 25038 25038 I JS : }
08-23 16:16:06.570 25038 25038 I JS : }
08-23 16:16:06.570 25038 25038 I JS : level0_1: {
08-23 16:16:06.570 25038 25038 I JS : "level1_0": "value3"
08-23 16:16:06.570 25038 25038 I JS : }
08-23 16:16:06.570 25038 25038 I JS : ==== object dump end ====`);
assertData(logger.output, `JS: ==== object dump start ====
JS: level0_0: {
JS: "level1_0": {
JS: "level2": "value"
JS: },
JS: "level1_1": {
JS: "level2": "value2"
JS: }
JS: }
JS: level0_1: {
JS: "level1_0": "value3"
JS: }
JS: ==== object dump end ====\n`);
});
it("multiline console.log statement", () => {
logDataForAndroid(`08-23 16:16:06.570 25038 25038 I JS : multiline
08-23 16:16:06.570 25038 25038 I JS : message
08-23 16:16:06.570 25038 25038 I JS : from
08-23 16:16:06.570 25038 25038 I JS : console.log`);
assertData(logger.output, `JS: multiline
JS: message
JS: from
JS: console.log\n`);
});
it("console.trace", async () => {
logDataForAndroid(`08-23 16:16:06.571 25038 25038 E JS : Trace: console.trace onTap
08-23 16:16:06.571 25038 25038 E JS : at viewModel.onTap (file:///data/data/org.nativescript.appTestLogs/files/app/bundle.js:297:17)
08-23 16:16:06.571 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3704:32)
08-23 16:16:06.571 25038 25038 E JS : at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3724:18)
08-23 16:16:06.571 25038 25038 E JS : at ClickListenerImpl.onClick (file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:14608:23)`);
assertData(logger.output, `JS: Trace: console.trace onTap
JS: at viewModel.onTap (file: app/main-view-model.js:39:0)
JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify (file: node_modules/tns-core-modules/data/observable/observable.js:107:0)
JS: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit (file: node_modules/tns-core-modules/data/observable/observable.js:127:0)
JS: at ClickListenerImpl.onClick (file: node_modules/tns-core-modules/ui/button/button.js:29:0)\n`);
});
it("console.time(timeEnd) statement", () => {
logDataForAndroid("08-23 16:16:06.571 25038 25038 I JS : console.time: 9510.00ms");
assertData(logger.output, "JS: console.time: 9510.00ms\n");
});
it("when an error is thrown, correct callstack is printed", async () => {
logDataForAndroid(`08-23 16:16:06.693 25038 25038 D AndroidRuntime: Shutting down VM
08-23 16:16:06.695 25038 25038 E AndroidRuntime: FATAL EXCEPTION: main
08-23 16:16:06.695 25038 25038 E AndroidRuntime: Process: org.nativescript.appTestLogs, PID: 25038
08-23 16:16:06.695 25038 25038 E AndroidRuntime: com.tns.NativeScriptException: Calling js method onClick failed
08-23 16:16:06.695 25038 25038 E AndroidRuntime: Error: Error in onTap
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethodNative(Native Method)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1083)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1063)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.Runtime.callJSMethod(Runtime.java:1055)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.view.View.performClick(View.java:6597)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.view.View.performClickInternal(View.java:6574)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.view.View.access$3100(View.java:778)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.view.View$PerformClick.run(View.java:25885)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:873)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.os.Looper.loop(Looper.java:193)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-23 16:16:06.695 25038 25038 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
08-23 16:16:06.798 25038 25038 W System.err: An uncaught Exception occurred on "main" thread.
08-23 16:16:06.798 25038 25038 W System.err: Calling js method onClick failed
08-23 16:16:06.798 25038 25038 W System.err: Error: Error in onTap
08-23 16:16:06.798 25038 25038 W System.err: ` + `
08-23 16:16:06.798 25038 25038 W System.err: StackTrace:
08-23 16:16:06.798 25038 25038 W System.err: viewModel.onTap(file:///data/data/org.nativescript.appTestLogs/files/app/bundle.js:301:15)
08-23 16:16:06.798 25038 25038 W System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify(file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3704:32)
08-23 16:16:06.798 25038 25038 W System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit(file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:3724:18)
08-23 16:16:06.798 25038 25038 W System.err: at ClickListenerImpl.onClick(file:///data/data/org.nativescript.appTestLogs/files/app/vendor.js:14608:23)
08-23 16:16:06.798 25038 25038 W System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
08-23 16:16:06.798 25038 25038 W System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
08-23 16:16:06.799 25038 25038 W System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
08-23 16:16:06.799 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083)
08-23 16:16:06.799 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063)
08-23 16:16:06.799 25038 25038 W System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055)
08-23 16:16:06.799 25038 25038 W System.err: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
08-23 16:16:06.799 25038 25038 W System.err: at android.view.View.performClick(View.java:6597)
08-23 16:16:06.799 25038 25038 W System.err: at android.view.View.performClickInternal(View.java:6574)
08-23 16:16:06.799 25038 25038 W System.err: at android.view.View.access$3100(View.java:778)
08-23 16:16:06.799 25038 25038 W System.err: at android.view.View$PerformClick.run(View.java:25885)
08-23 16:16:06.799 25038 25038 W System.err: at android.os.Handler.handleCallback(Handler.java:873)
08-23 16:16:06.799 25038 25038 W System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
08-23 16:16:06.799 25038 25038 W System.err: at android.os.Looper.loop(Looper.java:193)
08-23 16:16:06.799 25038 25038 W System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
08-23 16:16:06.799 25038 25038 W System.err: at java.lang.reflect.Method.invoke(Native Method)
08-23 16:16:06.799 25038 25038 W System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
08-23 16:16:06.799 25038 25038 W System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)`);
assertData(logger.output, `System.err: An uncaught Exception occurred on "main" thread.
System.err: Calling js method onClick failed
System.err: Error: Error in onTap
System.err: ` + `
System.err: StackTrace:
System.err: viewModel.onTap(file: app/main-view-model.js:43:0)
System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable.notify(file: node_modules/tns-core-modules/data/observable/observable.js:107:0)
System.err: at push.../node_modules/tns-core-modules/data/observable/observable.js.Observable._emit(file: node_modules/tns-core-modules/data/observable/observable.js:127:0)
System.err: at ClickListenerImpl.onClick(file: node_modules/tns-core-modules/ui/button/button.js:29:0)
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1209)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:1096)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1083)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1063)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:1055)
System.err: at com.tns.gen.java.lang.Object_vendor_14601_32_ClickListenerImpl.onClick(Object_vendor_14601_32_ClickListenerImpl.java:18)
System.err: at android.view.View.performClick(View.java:6597)
System.err: at android.view.View.performClickInternal(View.java:6574)
System.err: at android.view.View.access$3100(View.java:778)
System.err: at android.view.View$PerformClick.run(View.java:25885)
System.err: at android.os.Handler.handleCallback(Handler.java:873)
System.err: at android.os.Handler.dispatchMessage(Handler.java:99)
System.err: at android.os.Looper.loop(Looper.java:193)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6669)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)\n`);
});
});
});
});
describe("iOS", () => {
before(() => {
platform = "ios";
deviceLogProvider.setProjectNameForDevice(deviceIdentifier, "appTestLogs");
});
const logDataForiOS = (data: string): void => {
deviceLogProvider.logData(data + '\n', platform, deviceIdentifier);
};
describe("runtime version is below 6.1.0", () => {
before(() => {
runtimeVersion = "6.0.0";
deviceLogProvider.setProjectDirForDevice("deviceIdentifier", "dir_with_runtime_6.0.0");
});
describe("iOS 9", () => {
describe("simulator output", () => {
it("console.log", () => {
logDataForiOS("Aug 23 14:38:54 mcsofvladimirov appTestLogs[8455]: CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal.");
assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n");
});
it("console.dir", () => {
logDataForiOS(`Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: CONSOLE LOG file:///app/bundle.js:270:20:
==== object dump start ====
level0_0: {
"level1_0": {
"level2": "value"
},
"level1_1": {
"level2": "value2"
}
}
level0_1: {
"level1_0": "value3"
}
==== object dump end ====`);
assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0
==== object dump start ====
level0_0: {
"level1_0": {
"level2": "value"
},
"level1_1": {
"level2": "value2"
}
}
level0_1: {
"level1_0": "value3"
}
==== object dump end ====\n`);
});
it("multiline console.log statement", () => {
logDataForiOS(`Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: CONSOLE LOG file:///app/bundle.js:284:20: multiline
message
from
console.log`);
assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0 multiline
message
from
console.log\n`);
});
it("console.trace", async () => {
logDataForiOS(`Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: CONSOLE TRACE file:///app/bundle.js:289:22: console.trace onTap
1 onTap@file:///app/bundle.js:289:22
2 notify@file:///app/vendor.js:3756:37
3 _emit@file:///app/vendor.js:3776:24
4 tap@file:///app/vendor.js:15438:24
5 UIApplicationMain@[native code]
6 _start@file:///app/vendor.js:789:26
7 run@file:///app/vendor.js:817:11
8 @file:///app/bundle.js:155:16
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file:///app/runtime.js:751:34
11 checkDeferredModules@file:///app/runtime.js:44:42
12 webpackJsonpCallback@file:///app/runtime.js:31:39
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@:1:11
16 promiseReactionJob@:1:11`);
assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0 console.trace onTap
1 onTap@file: app/main-view-model.js:39:0
2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0
3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0
4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0
5 UIApplicationMain@[native code]
6 _start@file: node_modules/tns-core-modules/application/application.js:277:0
7 run@file: node_modules/tns-core-modules/application/application.js:305:0
8 @file: app/app.js:46:0
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file: app/webpack/bootstrap:750:0
11 checkDeferredModules@file: app/webpack/bootstrap:43:0
12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@:1:11
16 promiseReactionJob@:1:11\n`);
});
it("console.time(timeEnd) statement", () => {
logDataForiOS(`file:///app/main-view-model.js:41:0 CONSOLE INFO console.time: 3152.344ms`);
assertData(logger.output, "file:///app/main-view-model.js:41:0 CONSOLE INFO console.time: 3152.344ms\n");
});
it("when an error is thrown, correct callstack is printed", async () => {
logDataForiOS(`Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: ***** Fatal JavaScript exception - application has been terminated. *****
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: Native stack trace:
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 1 0x101a2e91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 2 0x101a66b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 3 0x102407dd6 ffi_closure_unix64_inner
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 4 0x1024087fa ffi_closure_unix64
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 5 0x103146e67 -[UIControl sendAction:to:forEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 6 0x103147143 -[UIControl _sendActionsForEvents:withEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 7 0x103146263 -[UIControl touchesEnded:withEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 8 0x10304699f -[UIWindow _sendTouchesForEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 9 0x1030476d4 -[UIWindow sendEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 10 0x102ff2dc6 -[UIApplication sendEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 11 0x102fcc553 _UIApplicationHandleEventQueue
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 12 0x10580b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 13 0x10580122c __CFRunLoopDoSources0
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 14 0x1058006e3 __CFRunLoopRun
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 15 0x1058000f8 CFRunLoopRunSpecific
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 16 0x106dc2ad2 GSEventRunModal
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 17 0x102fd1f09 UIApplicationMain
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 18 0x10240863d ffi_call_unix64
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 19 0x10fc91100
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: JavaScript stack trace:
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 1 onTap@file:///app/bundle.js:293:42
2 notify@file:///app/vendor.js:3756:37
3 _emit@file:///app/vendor.js:3776:24
4 tap@file:///app/vendor.js:15438:24
5 UIApplicationMain@[native code]
6 _start@file:///app/vendor.js:789:26
7 run@file:///app/vendor.js:817:11
8 @file:///app/bundle.js:155:16
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file:///app/runtime.js:751:34
11 checkDeferredModules@file:///app/runtime.js:44:42
12 webpackJsonpCallback@file:///app/runtime.js:31:39
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@[native code]
16 promiseReactionJob@[native code]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: JavaScript error:
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: file:///app/bundle.js:293:42: JS ERROR Error: Error in onTap
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: NativeScript caught signal 11.
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: Native Stack:
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 1 0x101a7384f sig_handler(int)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 2 0x1060e7b5d _sigtramp
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 3 0xffffffffffffffff
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 4 0x10607ef33 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 5 0x106082d84 _Unwind_RaiseException
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 6 0x105c99cd3 __cxa_throw
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 7 0x104ef2eea _objc_exception_destructor(void*)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 8 0x101a2ed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 9 0x101a66b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 10 0x102407dd6 ffi_closure_unix64_inner
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 11 0x1024087fa ffi_closure_unix64
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 12 0x103146e67 -[UIControl sendAction:to:forEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 13 0x103147143 -[UIControl _sendActionsForEvents:withEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 14 0x103146263 -[UIControl touchesEnded:withEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 15 0x10304699f -[UIWindow _sendTouchesForEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 16 0x1030476d4 -[UIWindow sendEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 17 0x102ff2dc6 -[UIApplication sendEvent:]
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 18 0x102fcc553 _UIApplicationHandleEventQueue
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 19 0x10580b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 20 0x10580122c __CFRunLoopDoSources0
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 21 0x1058006e3 __CFRunLoopRun
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 22 0x1058000f8 CFRunLoopRunSpecific
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 23 0x106dc2ad2 GSEventRunModal
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 24 0x102fd1f09 UIApplicationMain
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 25 0x10240863d ffi_call_unix64
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 26 0x10fc91100
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: JS Stack:
Aug 23 14:38:58 mcsofvladimirov appTestLogs[8455]: 1 UIApplicationMain@[native code]
2 _start@file:///app/vendor.js:789:26
3 run@file:///app/vendor.js:817:11
4 @file:///app/bundle.js:155:16
5 ./app.js@file:///app/bundle.js:172:34
6 __webpack_require__@file:///app/runtime.js:751:34
7 checkDeferredModules@file:///app/runtime.js:44:42
8 webpackJsonpCallback@file:///app/runtime.js:31:39
9 anonymous@file:///app/bundle.js:2:61
10 evaluate@[native code]
11 moduleEvaluation@:1:11
12 promiseReactionJob@:1:11`);
assertData(logger.output, `***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x101a2e91f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x101a66b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x102407dd6 ffi_closure_unix64_inner
4 0x1024087fa ffi_closure_unix64
5 0x103146e67 -[UIControl sendAction:to:forEvent:]
6 0x103147143 -[UIControl _sendActionsForEvents:withEvent:]
7 0x103146263 -[UIControl touchesEnded:withEvent:]
8 0x10304699f -[UIWindow _sendTouchesForEvent:]
9 0x1030476d4 -[UIWindow sendEvent:]
10 0x102ff2dc6 -[UIApplication sendEvent:]
11 0x102fcc553 _UIApplicationHandleEventQueue
12 0x10580b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
13 0x10580122c __CFRunLoopDoSources0
14 0x1058006e3 __CFRunLoopRun
15 0x1058000f8 CFRunLoopRunSpecific
16 0x106dc2ad2 GSEventRunModal
17 0x102fd1f09 UIApplicationMain
18 0x10240863d ffi_call_unix64
19 0x10fc91100
JavaScript stack trace:
1 onTap@file: app/main-view-model.js:43:0
2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0
3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0
4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0
5 UIApplicationMain@[native code]
6 _start@file: node_modules/tns-core-modules/application/application.js:277:0
7 run@file: node_modules/tns-core-modules/application/application.js:305:0
8 @file: app/app.js:46:0
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file: app/webpack/bootstrap:750:0
11 checkDeferredModules@file: app/webpack/bootstrap:43:0
12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@[native code]
16 promiseReactionJob@[native code]
JavaScript error:
file: app/main-view-model.js:43:0 JS ERROR Error: Error in onTap
NativeScript caught signal 11.
Native Stack:
1 0x101a7384f sig_handler(int)
2 0x1060e7b5d _sigtramp
3 0xffffffffffffffff
4 0x10607ef33 libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5 0x106082d84 _Unwind_RaiseException
6 0x105c99cd3 __cxa_throw
7 0x104ef2eea _objc_exception_destructor(void*)
8 0x101a2ed58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
9 0x101a66b60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
10 0x102407dd6 ffi_closure_unix64_inner
11 0x1024087fa ffi_closure_unix64
12 0x103146e67 -[UIControl sendAction:to:forEvent:]
13 0x103147143 -[UIControl _sendActionsForEvents:withEvent:]
14 0x103146263 -[UIControl touchesEnded:withEvent:]
15 0x10304699f -[UIWindow _sendTouchesForEvent:]
16 0x1030476d4 -[UIWindow sendEvent:]
17 0x102ff2dc6 -[UIApplication sendEvent:]
18 0x102fcc553 _UIApplicationHandleEventQueue
19 0x10580b301 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
20 0x10580122c __CFRunLoopDoSources0
21 0x1058006e3 __CFRunLoopRun
22 0x1058000f8 CFRunLoopRunSpecific
23 0x106dc2ad2 GSEventRunModal
24 0x102fd1f09 UIApplicationMain
25 0x10240863d ffi_call_unix64
26 0x10fc91100
JS Stack:
1 UIApplicationMain@[native code]
2 _start@file: node_modules/tns-core-modules/application/application.js:277:0
3 run@file: node_modules/tns-core-modules/application/application.js:305:0
4 @file: app/app.js:46:0
5 ./app.js@file:///app/bundle.js:172:34
6 __webpack_require__@file: app/webpack/bootstrap:750:0
7 checkDeferredModules@file: app/webpack/bootstrap:43:0
8 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
9 anonymous@file:///app/bundle.js:2:61
10 evaluate@[native code]
11 moduleEvaluation@:1:11
12 promiseReactionJob@:1:11\n`);
});
});
});
describe("iOS 12", () => {
describe("simulator output", () => {
it("console.log", () => {
logDataForiOS("2019-08-22 18:21:24.066975+0300 localhost appTestLogs[55619]: (NativeScript) CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal.");
assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0 HMR: Hot Module Replacement Enabled. Waiting for signal.\n");
});
it("console.dir", () => {
logDataForiOS(`2019-08-22 18:21:26.133151+0300 localhost appTestLogs[55619]: (NativeScript) CONSOLE LOG file:///app/bundle.js:270:20:
==== object dump start ====
level0_0: {
"level1_0": {
"level2": "value"
},
"level1_1": {
"level2": "value2"
}
}
level0_1: {
"level1_0": "value3"
}
==== object dump end ====`);
assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0
==== object dump start ====
level0_0: {
"level1_0": {
"level2": "value"
},
"level1_1": {
"level2": "value2"
}
}
level0_1: {
"level1_0": "value3"
}
==== object dump end ====\n`);
});
it("multiline console.log statement", () => {
logDataForiOS(`2019-08-22 18:21:26.133260+0300 localhost appTestLogs[55619]: (NativeScript) CONSOLE LOG file:///app/bundle.js:284:20: multiline
message
from
console.log`);
assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:34:0 multiline
message
from
console.log\n`);
});
it("console.trace", async () => {
logDataForiOS(`2019-08-22 18:21:26.133683+0300 localhost appTestLogs[55619]: (NativeScript) CONSOLE TRACE file:///app/bundle.js:289:22: console.trace onTap
1 onTap@file:///app/bundle.js:289:22
2 notify@file:///app/vendor.js:3756:37
3 _emit@file:///app/vendor.js:3776:24
4 tap@file:///app/vendor.js:15438:24
5 UIApplicationMain@[native code]
6 _start@file:///app/vendor.js:789:26
7 run@file:///app/vendor.js:817:11
8 @file:///app/bundle.js:155:16
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file:///app/runtime.js:751:34
11 checkDeferredModules@file:///app/runtime.js:44:42
12 webpackJsonpCallback@file:///app/runtime.js:31:39
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@:1:11
16 promiseReactionJob@:1:11`);
assertData(logger.output, `CONSOLE TRACE file: app/main-view-model.js:39:0 console.trace onTap
1 onTap@file: app/main-view-model.js:39:0
2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0
3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0
4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0
5 UIApplicationMain@[native code]
6 _start@file: node_modules/tns-core-modules/application/application.js:277:0
7 run@file: node_modules/tns-core-modules/application/application.js:305:0
8 @file: app/app.js:46:0
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file: app/webpack/bootstrap:750:0
11 checkDeferredModules@file: app/webpack/bootstrap:43:0
12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@:1:11
16 promiseReactionJob@:1:11\n`);
});
it("console.time(timeEnd) statement", () => {
logDataForiOS(`2019-08-22 18:21:26.133972+0300 localhost appTestLogs[55619]: (NativeScript) file:///app/bundle.js:291:24: CONSOLE INFO console.time: 1988.737ms`);
assertData(logger.output, "file: app/main-view-model.js:41:0 CONSOLE INFO console.time: 1988.737ms\n");
});
it("when an error is thrown, correct callstack is printed", async () => {
logDataForiOS(`2019-08-22 18:21:26.140685+0300 localhost appTestLogs[55619]: (NativeScript) ***** Fatal JavaScript exception - application has been terminated. *****
2019-08-22 18:21:26.140910+0300 localhost appTestLogs[55619]: (NativeScript) Native stack trace:
2019-08-22 18:21:26.141466+0300 localhost appTestLogs[55619]: (NativeScript) 1 0x10c82491f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2019-08-22 18:21:26.141583+0300 localhost appTestLogs[55619]: (NativeScript) 2 0x10c85cb60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2019-08-22 18:21:26.141674+0300 localhost appTestLogs[55619]: (NativeScript) 3 0x10d1fddd6 ffi_closure_unix64_inner
2019-08-22 18:21:26.141769+0300 localhost appTestLogs[55619]: (NativeScript) 4 0x10d1fe7fa ffi_closure_unix64
2019-08-22 18:21:26.142022+0300 localhost appTestLogs[55619]: (NativeScript) 5 0x110a32c19 -[UIControl sendAction:to:forEvent:]
2019-08-22 18:21:26.142743+0300 localhost appTestLogs[55619]: (NativeScript) 6 0x110a32f36 -[UIControl _sendActionsForEvents:withEvent:]
2019-08-22 18:21:26.142986+0300 localhost appTestLogs[55619]: (NativeScript) 7 0x110a31eec -[UIControl touchesEnded:withEvent:]
2019-08-22 18:21:26.145364+0300 localhost appTestLogs[55619]: (NativeScript) 8 0x111015eee -[UIWindow _sendTouchesForEvent:]
2019-08-22 18:21:26.146041+0300 localhost appTestLogs[55619]: (NativeScript) 9 0x1110175d2 -[UIWindow sendEvent:]
2019-08-22 18:21:26.146403+0300 localhost appTestLogs[55619]: (NativeScript) 10 0x110ff5d16 -[UIApplication sendEvent:]
2019-08-22 18:21:26.146875+0300 localhost appTestLogs[55619]: (NativeScript) 11 0x1110c6293 __dispatchPreprocessedEventFromEventQueue
2019-08-22 18:21:26.147326+0300 localhost appTestLogs[55619]: (NativeScript) 12 0x1110c8bb9 __handleEventQueueInternal
2019-08-22 18:21:26.147607+0300 localhost appTestLogs[55619]: (NativeScript) 13 0x10fafcbe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
2019-08-22 18:21:26.147850+0300 localhost appTestLogs[55619]: (NativeScript) 14 0x10fafc463 __CFRunLoopDoSources0
2019-08-22 18:21:26.148147+0300 localhost appTestLogs[55619]: (NativeScript) 15 0x10faf6b1f __CFRunLoopRun
2019-08-22 18:21:26.148400+0300 localhost appTestLogs[55619]: (NativeScript) 16 0x10faf6302 CFRunLoopRunSpecific
2019-08-22 18:21:26.148730+0300 localhost appTestLogs[55619]: (NativeScript) 17 0x116b7f2fe GSEventRunModal
2019-08-22 18:21:26.149116+0300 localhost appTestLogs[55619]: (NativeScript) 18 0x110fdbba2 UIApplicationMain
2019-08-22 18:21:26.149392+0300 localhost appTestLogs[55619]: (NativeScript) 19 0x10d1fe63d ffi_call_unix64
2019-08-22 18:21:26.149715+0300 localhost appTestLogs[55619]: (NativeScript) 20 0x123da2c60
2019-08-22 18:21:26.149935+0300 localhost appTestLogs[55619]: (NativeScript) JavaScript stack trace:
2019-08-22 18:21:26.150237+0300 localhost appTestLogs[55619]: (NativeScript) 1 onTap@file:///app/bundle.js:293:42
2 notify@file:///app/vendor.js:3756:37
3 _emit@file:///app/vendor.js:3776:24
4 tap@file:///app/vendor.js:15438:24
5 UIApplicationMain@[native code]
6 _start@file:///app/vendor.js:789:26
7 run@file:///app/vendor.js:817:11
8 @file:///app/bundle.js:155:16
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file:///app/runtime.js:751:34
11 checkDeferredModules@file:///app/runtime.js:44:42
12 webpackJsonpCallback@file:///app/runtime.js:31:39
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@[native code]
16 promiseReactionJob@[native code]
2019-08-22 18:21:26.150442+0300 localhost appTestLogs[55619]: (NativeScript) JavaScript error:
2019-08-22 18:21:26.150950+0300 localhost appTestLogs[55619]: (NativeScript) file:///app/bundle.js:293:42: JS ERROR Error: Error in onTap
2019-08-22 18:21:26.151895+0300 localhost appTestLogs[55619]: (NativeScript) NativeScript caught signal 11.
2019-08-22 18:21:26.152193+0300 localhost appTestLogs[55619]: (NativeScript) Native Stack:
2019-08-22 18:21:26.152517+0300 localhost appTestLogs[55619]: (NativeScript) 1 0x10c86984f sig_handler(int)
2019-08-22 18:21:26.152830+0300 localhost appTestLogs[55619]: (NativeScript) 2 0x1104adb5d _sigtramp
2019-08-22 18:21:26.153113+0300 localhost appTestLogs[55619]: (NativeScript) 3 0xffffffffffffffff
2019-08-22 18:21:26.153368+0300 localhost appTestLogs[55619]: (NativeScript) 4 0x1103f3b4d libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
2019-08-22 18:21:26.153701+0300 localhost appTestLogs[55619]: (NativeScript) 5 0x1103f7e4c _Unwind_RaiseException
2019-08-22 18:21:26.153931+0300 localhost appTestLogs[55619]: (NativeScript) 6 0x10ffd14aa __cxa_throw
2019-08-22 18:21:26.154180+0300 localhost appTestLogs[55619]: (NativeScript) 7 0x10e9eabfa _objc_exception_destructor(void*)
2019-08-22 18:21:26.154425+0300 localhost appTestLogs[55619]: (NativeScript) 8 0x10c824d58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2019-08-22 18:21:26.154680+0300 localhost appTestLogs[55619]: (NativeScript) 9 0x10c85cb60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
2019-08-22 18:21:26.154900+0300 localhost appTestLogs[55619]: (NativeScript) 10 0x10d1fddd6 ffi_closure_unix64_inner
2019-08-22 18:21:26.155189+0300 localhost appTestLogs[55619]: (NativeScript) 11 0x10d1fe7fa ffi_closure_unix64
2019-08-22 18:21:26.155473+0300 localhost appTestLogs[55619]: (NativeScript) 12 0x110a32c19 -[UIControl sendAction:to:forEvent:]
2019-08-22 18:21:26.155675+0300 localhost appTestLogs[55619]: (NativeScript) 13 0x110a32f36 -[UIControl _sendActionsForEvents:withEvent:]
2019-08-22 18:21:26.155885+0300 localhost appTestLogs[55619]: (NativeScript) 14 0x110a31eec -[UIControl touchesEnded:withEvent:]
2019-08-22 18:21:26.156116+0300 localhost appTestLogs[55619]: (NativeScript) 15 0x111015eee -[UIWindow _sendTouchesForEvent:]
2019-08-22 18:21:26.156345+0300 localhost appTestLogs[55619]: (NativeScript) 16 0x1110175d2 -[UIWindow sendEvent:]
2019-08-22 18:21:26.156541+0300 localhost appTestLogs[55619]: (NativeScript) 17 0x110ff5d16 -[UIApplication sendEvent:]
2019-08-22 18:21:26.157027+0300 localhost appTestLogs[55619]: (NativeScript) 18 0x1110c6293 __dispatchPreprocessedEventFromEventQueue
2019-08-22 18:21:26.159128+0300 localhost appTestLogs[55619]: (NativeScript) 19 0x1110c8bb9 __handleEventQueueInternal
2019-08-22 18:21:26.159227+0300 localhost appTestLogs[55619]: (NativeScript) 20 0x10fafcbe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
2019-08-22 18:21:26.159296+0300 localhost appTestLogs[55619]: (NativeScript) 21 0x10fafc463 __CFRunLoopDoSources0
2019-08-22 18:21:26.159357+0300 localhost appTestLogs[55619]: (NativeScript) 22 0x10faf6b1f __CFRunLoopRun
2019-08-22 18:21:26.159541+0300 localhost appTestLogs[55619]: (NativeScript) 23 0x10faf6302 CFRunLoopRunSpecific
2019-08-22 18:21:26.159861+0300 localhost appTestLogs[55619]: (NativeScript) 24 0x116b7f2fe GSEventRunModal
2019-08-22 18:21:26.160353+0300 localhost appTestLogs[55619]: (NativeScript) 25 0x110fdbba2 UIApplicationMain
2019-08-22 18:21:26.160626+0300 localhost appTestLogs[55619]: (NativeScript) 26 0x10d1fe63d ffi_call_unix64
2019-08-22 18:21:26.160825+0300 localhost appTestLogs[55619]: (NativeScript) 27 0x123da2c60
2019-08-22 18:21:26.161039+0300 localhost appTestLogs[55619]: (NativeScript) JS Stack:
2019-08-22 18:21:26.163639+0300 localhost assertiond[29105]: [com.apple.assertiond:process_info] [appTestLogs:55619] Setting jetsam priority to 3 [0x100]
2019-08-22 18:21:26.169429+0300 localhost locationd[29104]: Created Activity ID: 0x32750f3, Description: CL: notifyClientsWithData (Fallback)
2019-08-22 18:21:26.161367+0300 localhost appTestLogs[55619]: (NativeScript) 1 UIApplicationMain@[native code]
2 _start@file:///app/vendor.js:789:26
3 run@file:///app/vendor.js:817:11
4 @file:///app/bundle.js:155:16
5 ./app.js@file:///app/bundle.js:172:34
6 __webpack_require__@file:///app/runtime.js:751:34
7 checkDeferredModules@file:///app/runtime.js:44:42
8 webpackJsonpCallback@file:///app/runtime.js:31:39
9 anonymous@file:///app/bundle.js:2:61
10 evaluate@[native code]
11 moduleEvaluation@:1:11
12 promiseReactionJob@:1:11`);
assertData(logger.output, `***** Fatal JavaScript exception - application has been terminated. *****
Native stack trace:
1 0x10c82491f NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
2 0x10c85cb60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
3 0x10d1fddd6 ffi_closure_unix64_inner
4 0x10d1fe7fa ffi_closure_unix64
5 0x110a32c19 -[UIControl sendAction:to:forEvent:]
6 0x110a32f36 -[UIControl _sendActionsForEvents:withEvent:]
7 0x110a31eec -[UIControl touchesEnded:withEvent:]
8 0x111015eee -[UIWindow _sendTouchesForEvent:]
9 0x1110175d2 -[UIWindow sendEvent:]
10 0x110ff5d16 -[UIApplication sendEvent:]
11 0x1110c6293 __dispatchPreprocessedEventFromEventQueue
12 0x1110c8bb9 __handleEventQueueInternal
13 0x10fafcbe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
14 0x10fafc463 __CFRunLoopDoSources0
15 0x10faf6b1f __CFRunLoopRun
16 0x10faf6302 CFRunLoopRunSpecific
17 0x116b7f2fe GSEventRunModal
18 0x110fdbba2 UIApplicationMain
19 0x10d1fe63d ffi_call_unix64
20 0x123da2c60
JavaScript stack trace:
1 onTap@file: app/main-view-model.js:43:0
2 notify@file: node_modules/tns-core-modules/data/observable/observable.js:107:0
3 _emit@file: node_modules/tns-core-modules/data/observable/observable.js:127:0
4 tap@file: node_modules/tns-core-modules/ui/button/button.js:216:0
5 UIApplicationMain@[native code]
6 _start@file: node_modules/tns-core-modules/application/application.js:277:0
7 run@file: node_modules/tns-core-modules/application/application.js:305:0
8 @file: app/app.js:46:0
9 ./app.js@file:///app/bundle.js:172:34
10 __webpack_require__@file: app/webpack/bootstrap:750:0
11 checkDeferredModules@file: app/webpack/bootstrap:43:0
12 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
13 anonymous@file:///app/bundle.js:2:61
14 evaluate@[native code]
15 moduleEvaluation@[native code]
16 promiseReactionJob@[native code]
JavaScript error:
file: app/main-view-model.js:43:0 JS ERROR Error: Error in onTap
NativeScript caught signal 11.
Native Stack:
1 0x10c86984f sig_handler(int)
2 0x1104adb5d _sigtramp
3 0xffffffffffffffff
4 0x1103f3b4d libunwind::UnwindCursor<libunwind::LocalAddressSpace, libunwind::Registers_x86_64>::step()
5 0x1103f7e4c _Unwind_RaiseException
6 0x10ffd14aa __cxa_throw
7 0x10e9eabfa _objc_exception_destructor(void*)
8 0x10c824d58 NativeScript::reportFatalErrorBeforeShutdown(JSC::ExecState*, JSC::Exception*, bool)
9 0x10c85cb60 NativeScript::FFICallback<NativeScript::ObjCMethodCallback>::ffiClosureCallback(ffi_cif*, void*, void**, void*)
10 0x10d1fddd6 ffi_closure_unix64_inner
11 0x10d1fe7fa ffi_closure_unix64
12 0x110a32c19 -[UIControl sendAction:to:forEvent:]
13 0x110a32f36 -[UIControl _sendActionsForEvents:withEvent:]
14 0x110a31eec -[UIControl touchesEnded:withEvent:]
15 0x111015eee -[UIWindow _sendTouchesForEvent:]
16 0x1110175d2 -[UIWindow sendEvent:]
17 0x110ff5d16 -[UIApplication sendEvent:]
18 0x1110c6293 __dispatchPreprocessedEventFromEventQueue
19 0x1110c8bb9 __handleEventQueueInternal
20 0x10fafcbe1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
21 0x10fafc463 __CFRunLoopDoSources0
22 0x10faf6b1f __CFRunLoopRun
23 0x10faf6302 CFRunLoopRunSpecific
24 0x116b7f2fe GSEventRunModal
25 0x110fdbba2 UIApplicationMain
26 0x10d1fe63d ffi_call_unix64
27 0x123da2c60
JS Stack:
1 UIApplicationMain@[native code]
2 _start@file: node_modules/tns-core-modules/application/application.js:277:0
3 run@file: node_modules/tns-core-modules/application/application.js:305:0
4 @file: app/app.js:46:0
5 ./app.js@file:///app/bundle.js:172:34
6 __webpack_require__@file: app/webpack/bootstrap:750:0
7 checkDeferredModules@file: app/webpack/bootstrap:43:0
8 webpackJsonpCallback@file: app/webpack/bootstrap:30:0
9 anonymous@file:///app/bundle.js:2:61
10 evaluate@[native code]
11 moduleEvaluation@:1:11
12 promiseReactionJob@:1:11\n`);
});
});
});
});
describe("runtime version is 6.1.0 or later", () => {
before(() => {
runtimeVersion = "6.1.0";
// set this, so the caching in logSourceMapService will detect correct runtime
deviceLogProvider.setProjectDirForDevice("deviceIdentifier", "dir_with_runtime_6.1.0");
});
describe("iOS 9", () => {
describe("simulator output", () => {
it("console.log", () => {
logDataForiOS("Aug 23 18:12:39 mcsofvladimirov appTestLogs[29554]: (NativeScript) CONSOLE INFO file:///app/vendor.js:168:36: HMR: Hot Module Replacement Enabled. Waiting for signal.");
assertData(logger.output, "CONSOLE INFO file: node_modules/nativescript-dev-webpack/hot.js:3:0: HMR: Hot Module Replacement Enabled. Waiting for signal.\n");
});
it("console.dir", () => {
logDataForiOS(`Aug 23 18:12:39 mcsofvladimirov appTestLogs[29554]: CONSOLE LOG file:///app/bundle.js:270:20:
==== object dump start ====
level0_0: {
"level1_0": {
"level2": "value"
},
"level1_1": {
"level2": "value2"
}
}
level0_1: {
"level1_0": "value3"
}
==== object dump end ====`);
assertData(logger.output, `CONSOLE LOG file: app/main-view-model.js:20:0:
==== object dump start ====
level0_0: {
"level1_0": {