@@ -99,7 +99,7 @@ describe('DocumentReference', () => {
99
99
const db = newTestFirestore ( ) ;
100
100
expect ( ( ) => {
101
101
DocumentReference . fromJSON ( db , { } ) ;
102
- } ) . to . throw ;
102
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
103
103
} ) ;
104
104
105
105
it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -110,7 +110,7 @@ describe('DocumentReference', () => {
110
110
bundleName : 'test name' ,
111
111
bundle : 'test bundle'
112
112
} ) ;
113
- } ) . to . throw ;
113
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
114
114
} ) ;
115
115
116
116
it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -122,7 +122,7 @@ describe('DocumentReference', () => {
122
122
bundleName : 'test name' ,
123
123
bundle : 'test bundle'
124
124
} ) ;
125
- } ) . to . throw ;
125
+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
126
126
} ) ;
127
127
128
128
it ( 'fromJSON() throws with missing bundleSource' , ( ) => {
@@ -133,7 +133,7 @@ describe('DocumentReference', () => {
133
133
bundleName : 'test name' ,
134
134
bundle : 'test bundle'
135
135
} ) ;
136
- } ) . to . throw ;
136
+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
137
137
} ) ;
138
138
139
139
it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -145,7 +145,7 @@ describe('DocumentReference', () => {
145
145
bundleName : 'test name' ,
146
146
bundle : 'test bundle'
147
147
} ) ;
148
- } ) . to . throw ;
148
+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
149
149
} ) ;
150
150
151
151
it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -157,7 +157,7 @@ describe('DocumentReference', () => {
157
157
bundleName : 'test name' ,
158
158
bundle : 'test bundle'
159
159
} ) ;
160
- } ) . to . throw ;
160
+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'DocumentSnapshot'" ) ;
161
161
} ) ;
162
162
163
163
it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -168,7 +168,7 @@ describe('DocumentReference', () => {
168
168
bundleSource : 'DocumentSnapshot' ,
169
169
bundle : 'test bundle'
170
170
} ) ;
171
- } ) . to . throw ;
171
+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
172
172
} ) ;
173
173
174
174
it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -180,7 +180,7 @@ describe('DocumentReference', () => {
180
180
bundleName : 1 ,
181
181
bundle : 'test bundle'
182
182
} ) ;
183
- } ) . to . throw ;
183
+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
184
184
} ) ;
185
185
186
186
it ( 'fromJSON() throws with missing bundle' , ( ) => {
@@ -191,7 +191,7 @@ describe('DocumentReference', () => {
191
191
bundleSource : 'DocumentSnapshot' ,
192
192
bundleName : 'test name'
193
193
} ) ;
194
- } ) . to . throw ;
194
+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
195
195
} ) ;
196
196
197
197
it ( 'fromJSON() throws with invalid bundle' , ( ) => {
@@ -203,7 +203,7 @@ describe('DocumentReference', () => {
203
203
bundleName : 'test name' ,
204
204
bundle : 1
205
205
} ) ;
206
- } ) . to . throw ;
206
+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
207
207
} ) ;
208
208
209
209
it ( 'fromJSON() does not throw' , ( ) => {
@@ -564,7 +564,7 @@ describe('QuerySnapshot', () => {
564
564
const db = newTestFirestore ( ) ;
565
565
expect ( ( ) => {
566
566
querySnapshotFromJSON ( db , { } ) ;
567
- } ) . to . throw ;
567
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
568
568
} ) ;
569
569
570
570
it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -575,7 +575,7 @@ describe('QuerySnapshot', () => {
575
575
bundleName : 'test name' ,
576
576
bundle : 'test bundle'
577
577
} ) ;
578
- } ) . to . throw ;
578
+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
579
579
} ) ;
580
580
581
581
it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -587,18 +587,18 @@ describe('QuerySnapshot', () => {
587
587
bundleName : 'test name' ,
588
588
bundle : 'test bundle'
589
589
} ) ;
590
- } ) . to . throw ;
590
+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
591
591
} ) ;
592
592
593
- it ( 'fromJSON() throws with invalid type data' , ( ) => {
593
+ it ( 'fromJSON() throws with missing bundle source data' , ( ) => {
594
594
const db = newTestFirestore ( ) ;
595
595
expect ( ( ) => {
596
596
querySnapshotFromJSON ( db , {
597
597
type : QuerySnapshot . _jsonSchemaVersion ,
598
598
bundleName : 'test name' ,
599
599
bundle : 'test bundle'
600
600
} ) ;
601
- } ) . to . throw ;
601
+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
602
602
} ) ;
603
603
604
604
it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -610,7 +610,7 @@ describe('QuerySnapshot', () => {
610
610
bundleName : 'test name' ,
611
611
bundle : 'test bundle'
612
612
} ) ;
613
- } ) . to . throw ;
613
+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
614
614
} ) ;
615
615
616
616
it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -622,7 +622,7 @@ describe('QuerySnapshot', () => {
622
622
bundleName : 'test name' ,
623
623
bundle : 'test bundle'
624
624
} ) ;
625
- } ) . to . throw ;
625
+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'QuerySnapshot'" ) ;
626
626
} ) ;
627
627
628
628
it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -633,7 +633,7 @@ describe('QuerySnapshot', () => {
633
633
bundleSource : 'QuerySnapshot' ,
634
634
bundle : 'test bundle'
635
635
} ) ;
636
- } ) . to . throw ;
636
+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
637
637
} ) ;
638
638
639
639
it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -645,21 +645,21 @@ describe('QuerySnapshot', () => {
645
645
bundleName : 1 ,
646
646
bundle : 'test bundle'
647
647
} ) ;
648
- } ) . to . throw ;
648
+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
649
649
} ) ;
650
650
651
- it ( 'fromJSON() throws with missing bundle data ' , ( ) => {
651
+ it ( 'fromJSON() throws with missing bundle field ' , ( ) => {
652
652
const db = newTestFirestore ( ) ;
653
653
expect ( ( ) => {
654
654
querySnapshotFromJSON ( db , {
655
655
type : QuerySnapshot . _jsonSchemaVersion ,
656
656
bundleSource : 'QuerySnapshot' ,
657
657
bundleName : 'test name'
658
658
} ) ;
659
- } ) . to . throw ;
659
+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
660
660
} ) ;
661
661
662
- it ( 'fromJSON() throws with invalid bundle data ' , ( ) => {
662
+ it ( 'fromJSON() throws with invalid bundle field ' , ( ) => {
663
663
const db = newTestFirestore ( ) ;
664
664
expect ( ( ) => {
665
665
querySnapshotFromJSON ( db , {
@@ -668,7 +668,7 @@ describe('QuerySnapshot', () => {
668
668
bundleName : 'test name' ,
669
669
bundle : 1
670
670
} ) ;
671
- } ) . to . throw ;
671
+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
672
672
} ) ;
673
673
674
674
it ( 'fromJSON does not throw' , ( ) => {
0 commit comments