@@ -97,7 +97,7 @@ describe('DocumentReference', () => {
97
97
const db = newTestFirestore ( ) ;
98
98
expect ( ( ) => {
99
99
DocumentReference . fromJSON ( db , { } ) ;
100
- } ) . to . throw ;
100
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
101
101
} ) ;
102
102
103
103
it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -108,7 +108,7 @@ describe('DocumentReference', () => {
108
108
bundleName : 'test name' ,
109
109
bundle : 'test bundle'
110
110
} ) ;
111
- } ) . to . throw ;
111
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
112
112
} ) ;
113
113
114
114
it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -120,7 +120,7 @@ describe('DocumentReference', () => {
120
120
bundleName : 'test name' ,
121
121
bundle : 'test bundle'
122
122
} ) ;
123
- } ) . to . throw ;
123
+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
124
124
} ) ;
125
125
126
126
it ( 'fromJSON() throws with missing bundleSource' , ( ) => {
@@ -131,7 +131,7 @@ describe('DocumentReference', () => {
131
131
bundleName : 'test name' ,
132
132
bundle : 'test bundle'
133
133
} ) ;
134
- } ) . to . throw ;
134
+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
135
135
} ) ;
136
136
137
137
it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -143,7 +143,7 @@ describe('DocumentReference', () => {
143
143
bundleName : 'test name' ,
144
144
bundle : 'test bundle'
145
145
} ) ;
146
- } ) . to . throw ;
146
+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
147
147
} ) ;
148
148
149
149
it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -155,7 +155,7 @@ describe('DocumentReference', () => {
155
155
bundleName : 'test name' ,
156
156
bundle : 'test bundle'
157
157
} ) ;
158
- } ) . to . throw ;
158
+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'DocumentSnapshot'" ) ;
159
159
} ) ;
160
160
161
161
it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -166,7 +166,7 @@ describe('DocumentReference', () => {
166
166
bundleSource : 'DocumentSnapshot' ,
167
167
bundle : 'test bundle'
168
168
} ) ;
169
- } ) . to . throw ;
169
+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
170
170
} ) ;
171
171
172
172
it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -178,7 +178,7 @@ describe('DocumentReference', () => {
178
178
bundleName : 1 ,
179
179
bundle : 'test bundle'
180
180
} ) ;
181
- } ) . to . throw ;
181
+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
182
182
} ) ;
183
183
184
184
it ( 'fromJSON() throws with missing bundle' , ( ) => {
@@ -189,7 +189,7 @@ describe('DocumentReference', () => {
189
189
bundleSource : 'DocumentSnapshot' ,
190
190
bundleName : 'test name'
191
191
} ) ;
192
- } ) . to . throw ;
192
+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
193
193
} ) ;
194
194
195
195
it ( 'fromJSON() throws with invalid bundle' , ( ) => {
@@ -201,7 +201,7 @@ describe('DocumentReference', () => {
201
201
bundleName : 'test name' ,
202
202
bundle : 1
203
203
} ) ;
204
- } ) . to . throw ;
204
+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
205
205
} ) ;
206
206
207
207
it ( 'fromJSON() does not throw' , ( ) => {
@@ -500,7 +500,7 @@ describe('QuerySnapshot', () => {
500
500
const db = newTestFirestore ( ) ;
501
501
expect ( ( ) => {
502
502
querySnapshotFromJSON ( db , { } ) ;
503
- } ) . to . throw ;
503
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
504
504
} ) ;
505
505
506
506
it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -511,7 +511,7 @@ describe('QuerySnapshot', () => {
511
511
bundleName : 'test name' ,
512
512
bundle : 'test bundle'
513
513
} ) ;
514
- } ) . to . throw ;
514
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
515
515
} ) ;
516
516
517
517
it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -523,18 +523,18 @@ describe('QuerySnapshot', () => {
523
523
bundleName : 'test name' ,
524
524
bundle : 'test bundle'
525
525
} ) ;
526
- } ) . to . throw ;
526
+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
527
527
} ) ;
528
528
529
- it ( 'fromJSON() throws with invalid type data' , ( ) => {
529
+ it ( 'fromJSON() throws with missing bundle source data' , ( ) => {
530
530
const db = newTestFirestore ( ) ;
531
531
expect ( ( ) => {
532
532
querySnapshotFromJSON ( db , {
533
533
type : QuerySnapshot . _jsonSchemaVersion ,
534
534
bundleName : 'test name' ,
535
535
bundle : 'test bundle'
536
536
} ) ;
537
- } ) . to . throw ;
537
+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
538
538
} ) ;
539
539
540
540
it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -546,7 +546,7 @@ describe('QuerySnapshot', () => {
546
546
bundleName : 'test name' ,
547
547
bundle : 'test bundle'
548
548
} ) ;
549
- } ) . to . throw ;
549
+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
550
550
} ) ;
551
551
552
552
it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -558,7 +558,7 @@ describe('QuerySnapshot', () => {
558
558
bundleName : 'test name' ,
559
559
bundle : 'test bundle'
560
560
} ) ;
561
- } ) . to . throw ;
561
+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'QuerySnapshot'" ) ;
562
562
} ) ;
563
563
564
564
it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -569,7 +569,7 @@ describe('QuerySnapshot', () => {
569
569
bundleSource : 'QuerySnapshot' ,
570
570
bundle : 'test bundle'
571
571
} ) ;
572
- } ) . to . throw ;
572
+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
573
573
} ) ;
574
574
575
575
it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -581,21 +581,21 @@ describe('QuerySnapshot', () => {
581
581
bundleName : 1 ,
582
582
bundle : 'test bundle'
583
583
} ) ;
584
- } ) . to . throw ;
584
+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
585
585
} ) ;
586
586
587
- it ( 'fromJSON() throws with missing bundle data ' , ( ) => {
587
+ it ( 'fromJSON() throws with missing bundle field ' , ( ) => {
588
588
const db = newTestFirestore ( ) ;
589
589
expect ( ( ) => {
590
590
querySnapshotFromJSON ( db , {
591
591
type : QuerySnapshot . _jsonSchemaVersion ,
592
592
bundleSource : 'QuerySnapshot' ,
593
593
bundleName : 'test name'
594
594
} ) ;
595
- } ) . to . throw ;
595
+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
596
596
} ) ;
597
597
598
- it ( 'fromJSON() throws with invalid bundle data ' , ( ) => {
598
+ it ( 'fromJSON() throws with invalid bundle field ' , ( ) => {
599
599
const db = newTestFirestore ( ) ;
600
600
expect ( ( ) => {
601
601
querySnapshotFromJSON ( db , {
@@ -604,7 +604,7 @@ describe('QuerySnapshot', () => {
604
604
bundleName : 'test name' ,
605
605
bundle : 1
606
606
} ) ;
607
- } ) . to . throw ;
607
+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
608
608
} ) ;
609
609
610
610
it ( 'fromJSON does not throw' , ( ) => {
0 commit comments