@@ -215,7 +215,7 @@ describe('JsonService', () => {
215
215
expect ( result ) . toEqual ( {
216
216
downloaded : true ,
217
217
path : testPath ,
218
- data : testData ,
218
+ data : JSON . stringify ( testData ) ,
219
219
} ) ;
220
220
} ) ;
221
221
it ( 'should return data (number)' , async ( ) => {
@@ -236,7 +236,7 @@ describe('JsonService', () => {
236
236
expect ( result ) . toEqual ( {
237
237
downloaded : true ,
238
238
path : testPath ,
239
- data : testData ,
239
+ data : JSON . stringify ( testData ) ,
240
240
} ) ;
241
241
} ) ;
242
242
it ( 'should return data (integer)' , async ( ) => {
@@ -257,7 +257,7 @@ describe('JsonService', () => {
257
257
expect ( result ) . toEqual ( {
258
258
downloaded : true ,
259
259
path : testPath ,
260
- data : testData ,
260
+ data : JSON . stringify ( testData ) ,
261
261
} ) ;
262
262
} ) ;
263
263
it ( 'should return data (boolean)' , async ( ) => {
@@ -278,7 +278,7 @@ describe('JsonService', () => {
278
278
expect ( result ) . toEqual ( {
279
279
downloaded : true ,
280
280
path : testPath ,
281
- data : testData ,
281
+ data : JSON . stringify ( testData ) ,
282
282
} ) ;
283
283
} ) ;
284
284
it ( 'should return data (null)' , async ( ) => {
@@ -299,7 +299,7 @@ describe('JsonService', () => {
299
299
expect ( result ) . toEqual ( {
300
300
downloaded : true ,
301
301
path : testPath ,
302
- data : testData ,
302
+ data : JSON . stringify ( testData ) ,
303
303
} ) ;
304
304
} ) ;
305
305
it ( 'should return data (array)' , async ( ) => {
@@ -328,7 +328,7 @@ describe('JsonService', () => {
328
328
expect ( result ) . toEqual ( {
329
329
downloaded : true ,
330
330
path : testPath ,
331
- data : testData ,
331
+ data : JSON . stringify ( testData ) ,
332
332
} ) ;
333
333
} ) ;
334
334
it ( 'should return data (object)' , async ( ) => {
@@ -355,7 +355,7 @@ describe('JsonService', () => {
355
355
expect ( result ) . toEqual ( {
356
356
downloaded : true ,
357
357
path : testPath ,
358
- data : testData ,
358
+ data : JSON . stringify ( testData ) ,
359
359
} ) ;
360
360
} ) ;
361
361
it ( 'should return full json data when forceRetrieve is true' , async ( ) => {
@@ -393,7 +393,7 @@ describe('JsonService', () => {
393
393
expect ( result ) . toEqual ( {
394
394
downloaded : true ,
395
395
path : testPath ,
396
- data : testData ,
396
+ data : JSON . stringify ( testData ) ,
397
397
} ) ;
398
398
} ) ;
399
399
} ) ;
@@ -432,7 +432,7 @@ describe('JsonService', () => {
432
432
expect ( result ) . toEqual ( {
433
433
downloaded : true ,
434
434
path : testPath ,
435
- data : testData ,
435
+ data : JSON . stringify ( testData ) ,
436
436
} ) ;
437
437
} ) ;
438
438
@@ -462,7 +462,7 @@ describe('JsonService', () => {
462
462
expect ( result ) . toEqual ( {
463
463
downloaded : true ,
464
464
path : testPath ,
465
- data : testData ,
465
+ data : JSON . stringify ( testData ) ,
466
466
} ) ;
467
467
} ) ;
468
468
} ) ;
@@ -503,11 +503,11 @@ describe('JsonService', () => {
503
503
expect ( result ) . toEqual ( {
504
504
downloaded : false ,
505
505
path : testPath ,
506
- data : testData ,
506
+ data : JSON . stringify ( testData ) ,
507
507
type : 'string' ,
508
508
} ) ;
509
509
} ) ;
510
- it ( 'should return array with scalar values and safe struct types descriptions' , async ( ) => {
510
+ it ( 'should return array with scalar values as strings and safe struct types descriptions' , async ( ) => {
511
511
const testData = [
512
512
12 ,
513
513
3.14 ,
@@ -555,35 +555,35 @@ describe('JsonService', () => {
555
555
path : '[0]' ,
556
556
cardinality : 1 ,
557
557
type : 'integer' ,
558
- value : testData [ 0 ] ,
558
+ value : String ( testData [ 0 ] ) ,
559
559
} ,
560
560
{
561
561
key : 1 ,
562
562
path : '[1]' ,
563
563
cardinality : 1 ,
564
564
type : 'number' ,
565
- value : testData [ 1 ] ,
565
+ value : String ( testData [ 1 ] ) ,
566
566
} ,
567
567
{
568
568
key : 2 ,
569
569
path : '[2]' ,
570
570
cardinality : 1 ,
571
571
type : 'string' ,
572
- value : testData [ 2 ] ,
572
+ value : `" ${ testData [ 2 ] } "` ,
573
573
} ,
574
574
{
575
575
key : 3 ,
576
576
path : '[3]' ,
577
577
cardinality : 1 ,
578
578
type : 'boolean' ,
579
- value : testData [ 3 ] ,
579
+ value : String ( testData [ 3 ] ) ,
580
580
} ,
581
581
{
582
582
key : 4 ,
583
583
path : '[4]' ,
584
584
cardinality : 1 ,
585
585
type : 'null' ,
586
- value : testData [ 4 ] ,
586
+ value : String ( testData [ 4 ] ) ,
587
587
} ,
588
588
{
589
589
key : 5 ,
@@ -654,19 +654,19 @@ describe('JsonService', () => {
654
654
path : `${ path } [0]` ,
655
655
cardinality : 1 ,
656
656
type : 'integer' ,
657
- value : testData [ 0 ] ,
657
+ value : String ( testData [ 0 ] ) ,
658
658
} ,
659
659
{
660
660
key : 1 ,
661
661
path : `${ path } [1]` ,
662
662
cardinality : 1 ,
663
663
type : 'string' ,
664
- value : testData [ 1 ] ,
664
+ value : `" ${ testData [ 1 ] } "` ,
665
665
} ,
666
666
] ,
667
667
} ) ;
668
668
} ) ;
669
- it ( 'should return object with scalar values and safe struct types descriptions' , async ( ) => {
669
+ it ( 'should return object with scalar values as strings and safe struct types descriptions' , async ( ) => {
670
670
const testData = {
671
671
fInt : 12 ,
672
672
fNum : 3.14 ,
@@ -752,35 +752,35 @@ describe('JsonService', () => {
752
752
path : '["fInt"]' ,
753
753
cardinality : 1 ,
754
754
type : 'integer' ,
755
- value : testData . fInt ,
755
+ value : String ( testData . fInt ) ,
756
756
} ,
757
757
{
758
758
key : 'fNum' ,
759
759
path : '["fNum"]' ,
760
760
cardinality : 1 ,
761
761
type : 'number' ,
762
- value : testData . fNum ,
762
+ value : String ( testData . fNum ) ,
763
763
} ,
764
764
{
765
765
key : 'fStr' ,
766
766
path : '["fStr"]' ,
767
767
cardinality : 1 ,
768
768
type : 'string' ,
769
- value : testData . fStr ,
769
+ value : `" ${ testData . fStr } "` ,
770
770
} ,
771
771
{
772
772
key : 'fBool' ,
773
773
path : '["fBool"]' ,
774
774
cardinality : 1 ,
775
775
type : 'boolean' ,
776
- value : testData . fBool ,
776
+ value : String ( testData . fBool ) ,
777
777
} ,
778
778
{
779
779
key : 'fNull' ,
780
780
path : '["fNull"]' ,
781
781
cardinality : 1 ,
782
782
type : 'null' ,
783
- value : testData . fNull ,
783
+ value : String ( testData . fNull ) ,
784
784
} ,
785
785
{
786
786
key : 'fArr' ,
@@ -797,7 +797,7 @@ describe('JsonService', () => {
797
797
] ,
798
798
} ) ;
799
799
} ) ;
800
- it ( 'should return object with scalar values in a custom path' , async ( ) => {
800
+ it ( 'should return object with scalar values as strings in a custom path' , async ( ) => {
801
801
const path = '["customPath"]' ;
802
802
const testData = {
803
803
fInt : 12 ,
@@ -855,14 +855,14 @@ describe('JsonService', () => {
855
855
path : `${ path } ["fInt"]` ,
856
856
cardinality : 1 ,
857
857
type : 'integer' ,
858
- value : testData . fInt ,
858
+ value : String ( testData . fInt ) ,
859
859
} ,
860
860
{
861
861
key : 'fStr' ,
862
862
path : `${ path } ["fStr"]` ,
863
863
cardinality : 1 ,
864
864
type : 'string' ,
865
- value : testData . fStr ,
865
+ value : `" ${ testData . fStr } "` ,
866
866
} ,
867
867
] ,
868
868
} ) ;
0 commit comments