@@ -99,7 +99,7 @@ describe('DocumentReference', () => {
9999 const db = newTestFirestore ( ) ;
100100 expect ( ( ) => {
101101 DocumentReference . fromJSON ( db , { } ) ;
102- } ) . to . throw ;
102+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
103103 } ) ;
104104
105105 it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -110,7 +110,7 @@ describe('DocumentReference', () => {
110110 bundleName : 'test name' ,
111111 bundle : 'test bundle'
112112 } ) ;
113- } ) . to . throw ;
113+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
114114 } ) ;
115115
116116 it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -122,7 +122,7 @@ describe('DocumentReference', () => {
122122 bundleName : 'test name' ,
123123 bundle : 'test bundle'
124124 } ) ;
125- } ) . to . throw ;
125+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
126126 } ) ;
127127
128128 it ( 'fromJSON() throws with missing bundleSource' , ( ) => {
@@ -133,7 +133,7 @@ describe('DocumentReference', () => {
133133 bundleName : 'test name' ,
134134 bundle : 'test bundle'
135135 } ) ;
136- } ) . to . throw ;
136+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
137137 } ) ;
138138
139139 it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -145,7 +145,7 @@ describe('DocumentReference', () => {
145145 bundleName : 'test name' ,
146146 bundle : 'test bundle'
147147 } ) ;
148- } ) . to . throw ;
148+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
149149 } ) ;
150150
151151 it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -157,7 +157,7 @@ describe('DocumentReference', () => {
157157 bundleName : 'test name' ,
158158 bundle : 'test bundle'
159159 } ) ;
160- } ) . to . throw ;
160+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'DocumentSnapshot'" ) ;
161161 } ) ;
162162
163163 it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -168,7 +168,7 @@ describe('DocumentReference', () => {
168168 bundleSource : 'DocumentSnapshot' ,
169169 bundle : 'test bundle'
170170 } ) ;
171- } ) . to . throw ;
171+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
172172 } ) ;
173173
174174 it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -180,7 +180,7 @@ describe('DocumentReference', () => {
180180 bundleName : 1 ,
181181 bundle : 'test bundle'
182182 } ) ;
183- } ) . to . throw ;
183+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
184184 } ) ;
185185
186186 it ( 'fromJSON() throws with missing bundle' , ( ) => {
@@ -191,7 +191,7 @@ describe('DocumentReference', () => {
191191 bundleSource : 'DocumentSnapshot' ,
192192 bundleName : 'test name'
193193 } ) ;
194- } ) . to . throw ;
194+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
195195 } ) ;
196196
197197 it ( 'fromJSON() throws with invalid bundle' , ( ) => {
@@ -203,7 +203,7 @@ describe('DocumentReference', () => {
203203 bundleName : 'test name' ,
204204 bundle : 1
205205 } ) ;
206- } ) . to . throw ;
206+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
207207 } ) ;
208208
209209 it ( 'fromJSON() does not throw' , ( ) => {
@@ -564,7 +564,7 @@ describe('QuerySnapshot', () => {
564564 const db = newTestFirestore ( ) ;
565565 expect ( ( ) => {
566566 querySnapshotFromJSON ( db , { } ) ;
567- } ) . to . throw ;
567+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
568568 } ) ;
569569
570570 it ( 'fromJSON() throws with missing type data' , ( ) => {
@@ -575,7 +575,7 @@ describe('QuerySnapshot', () => {
575575 bundleName : 'test name' ,
576576 bundle : 'test bundle'
577577 } ) ;
578- } ) . to . throw ;
578+ } ) . to . throw ( "JSON missing required field: 'type'" ) ;
579579 } ) ;
580580
581581 it ( 'fromJSON() throws with invalid type data' , ( ) => {
@@ -587,18 +587,18 @@ describe('QuerySnapshot', () => {
587587 bundleName : 'test name' ,
588588 bundle : 'test bundle'
589589 } ) ;
590- } ) . to . throw ;
590+ } ) . to . throw ( "JSON field 'type' must be a string" ) ;
591591 } ) ;
592592
593- it ( 'fromJSON() throws with invalid type data' , ( ) => {
593+ it ( 'fromJSON() throws with missing bundle source data' , ( ) => {
594594 const db = newTestFirestore ( ) ;
595595 expect ( ( ) => {
596596 querySnapshotFromJSON ( db , {
597597 type : QuerySnapshot . _jsonSchemaVersion ,
598598 bundleName : 'test name' ,
599599 bundle : 'test bundle'
600600 } ) ;
601- } ) . to . throw ;
601+ } ) . to . throw ( "JSON missing required field: 'bundleSource'" ) ;
602602 } ) ;
603603
604604 it ( 'fromJSON() throws with invalid bundleSource type' , ( ) => {
@@ -610,7 +610,7 @@ describe('QuerySnapshot', () => {
610610 bundleName : 'test name' ,
611611 bundle : 'test bundle'
612612 } ) ;
613- } ) . to . throw ;
613+ } ) . to . throw ( "JSON field 'bundleSource' must be a string" ) ;
614614 } ) ;
615615
616616 it ( 'fromJSON() throws with invalid bundleSource value' , ( ) => {
@@ -622,7 +622,7 @@ describe('QuerySnapshot', () => {
622622 bundleName : 'test name' ,
623623 bundle : 'test bundle'
624624 } ) ;
625- } ) . to . throw ;
625+ } ) . to . throw ( "Expected 'bundleSource' field to equal 'QuerySnapshot'" ) ;
626626 } ) ;
627627
628628 it ( 'fromJSON() throws with missing bundleName' , ( ) => {
@@ -633,7 +633,7 @@ describe('QuerySnapshot', () => {
633633 bundleSource : 'QuerySnapshot' ,
634634 bundle : 'test bundle'
635635 } ) ;
636- } ) . to . throw ;
636+ } ) . to . throw ( "JSON missing required field: 'bundleName'" ) ;
637637 } ) ;
638638
639639 it ( 'fromJSON() throws with invalid bundleName' , ( ) => {
@@ -645,21 +645,21 @@ describe('QuerySnapshot', () => {
645645 bundleName : 1 ,
646646 bundle : 'test bundle'
647647 } ) ;
648- } ) . to . throw ;
648+ } ) . to . throw ( "JSON field 'bundleName' must be a string" ) ;
649649 } ) ;
650650
651- it ( 'fromJSON() throws with missing bundle data ' , ( ) => {
651+ it ( 'fromJSON() throws with missing bundle field ' , ( ) => {
652652 const db = newTestFirestore ( ) ;
653653 expect ( ( ) => {
654654 querySnapshotFromJSON ( db , {
655655 type : QuerySnapshot . _jsonSchemaVersion ,
656656 bundleSource : 'QuerySnapshot' ,
657657 bundleName : 'test name'
658658 } ) ;
659- } ) . to . throw ;
659+ } ) . to . throw ( "JSON missing required field: 'bundle'" ) ;
660660 } ) ;
661661
662- it ( 'fromJSON() throws with invalid bundle data ' , ( ) => {
662+ it ( 'fromJSON() throws with invalid bundle field ' , ( ) => {
663663 const db = newTestFirestore ( ) ;
664664 expect ( ( ) => {
665665 querySnapshotFromJSON ( db , {
@@ -668,7 +668,7 @@ describe('QuerySnapshot', () => {
668668 bundleName : 'test name' ,
669669 bundle : 1
670670 } ) ;
671- } ) . to . throw ;
671+ } ) . to . throw ( "JSON field 'bundle' must be a string" ) ;
672672 } ) ;
673673
674674 it ( 'fromJSON does not throw' , ( ) => {
0 commit comments