@@ -109,8 +109,11 @@ describe('Datastore', () => {
109
109
) ;
110
110
datastore . terminate ( ) ;
111
111
await expect ( invokeDatastoreImplInvokeRpc ( datastore ) )
112
- . to . eventually . be . rejectedWith ( / t e r m i n a t e d / i)
113
- . and . have . property ( 'code' , Code . FAILED_PRECONDITION ) ;
112
+ . to . eventually . be . rejectedWith ( / t e r m i n a t e d / )
113
+ . and . include ( {
114
+ 'name' : 'FirebaseError' ,
115
+ 'code' : Code . FAILED_PRECONDITION
116
+ } ) ;
114
117
} ) ;
115
118
116
119
it ( 'DatastoreImpl.invokeRPC() rethrows a FirestoreError' , async ( ) => {
@@ -121,7 +124,10 @@ describe('Datastore', () => {
121
124
const datastore = newDatastore ( credentials , connection , serializer ) ;
122
125
await expect ( invokeDatastoreImplInvokeRpc ( datastore ) )
123
126
. to . eventually . be . rejectedWith ( 'zzyzx' )
124
- . and . have . property ( 'code' , Code . ABORTED ) ;
127
+ . and . include ( {
128
+ 'name' : 'FirebaseError' ,
129
+ 'code' : Code . ABORTED
130
+ } ) ;
125
131
expect ( credentials . invalidateTokenInvoked ) . to . be . false ;
126
132
} ) ;
127
133
@@ -132,7 +138,10 @@ describe('Datastore', () => {
132
138
const datastore = newDatastore ( credentials , connection , serializer ) ;
133
139
await expect ( invokeDatastoreImplInvokeRpc ( datastore ) )
134
140
. to . eventually . be . rejectedWith ( 'zzyzx' )
135
- . and . have . property ( 'code' , Code . UNKNOWN ) ;
141
+ . and . include ( {
142
+ 'name' : 'FirebaseError' ,
143
+ 'code' : Code . UNKNOWN
144
+ } ) ;
136
145
expect ( credentials . invalidateTokenInvoked ) . to . be . false ;
137
146
} ) ;
138
147
@@ -144,7 +153,10 @@ describe('Datastore', () => {
144
153
const datastore = newDatastore ( credentials , connection , serializer ) ;
145
154
await expect ( invokeDatastoreImplInvokeRpc ( datastore ) )
146
155
. to . eventually . be . rejectedWith ( 'zzyzx' )
147
- . and . have . property ( 'code' , Code . UNAUTHENTICATED ) ;
156
+ . and . include ( {
157
+ 'name' : 'FirebaseError' ,
158
+ 'code' : Code . UNAUTHENTICATED
159
+ } ) ;
148
160
expect ( credentials . invalidateTokenInvoked ) . to . be . true ;
149
161
} ) ;
150
162
@@ -156,8 +168,11 @@ describe('Datastore', () => {
156
168
) ;
157
169
datastore . terminate ( ) ;
158
170
await expect ( invokeDatastoreImplInvokeStreamingRPC ( datastore ) )
159
- . to . eventually . be . rejectedWith ( / t e r m i n a t e d / i)
160
- . and . have . property ( 'code' , Code . FAILED_PRECONDITION ) ;
171
+ . to . eventually . be . rejectedWith ( / t e r m i n a t e d / )
172
+ . and . include ( {
173
+ 'name' : 'FirebaseError' ,
174
+ 'code' : Code . FAILED_PRECONDITION
175
+ } ) ;
161
176
} ) ;
162
177
163
178
it ( 'DatastoreImpl.invokeStreamingRPC() rethrows a FirestoreError' , async ( ) => {
@@ -168,7 +183,10 @@ describe('Datastore', () => {
168
183
const datastore = newDatastore ( credentials , connection , serializer ) ;
169
184
await expect ( invokeDatastoreImplInvokeStreamingRPC ( datastore ) )
170
185
. to . eventually . be . rejectedWith ( 'zzyzx' )
171
- . and . have . property ( 'code' , Code . ABORTED ) ;
186
+ . and . include ( {
187
+ 'name' : 'FirebaseError' ,
188
+ 'code' : Code . ABORTED
189
+ } ) ;
172
190
expect ( credentials . invalidateTokenInvoked ) . to . be . false ;
173
191
} ) ;
174
192
@@ -179,7 +197,10 @@ describe('Datastore', () => {
179
197
const datastore = newDatastore ( credentials , connection , serializer ) ;
180
198
await expect ( invokeDatastoreImplInvokeStreamingRPC ( datastore ) )
181
199
. to . eventually . be . rejectedWith ( 'zzyzx' )
182
- . and . have . property ( 'code' , Code . UNKNOWN ) ;
200
+ . and . include ( {
201
+ 'name' : 'FirebaseError' ,
202
+ 'code' : Code . UNKNOWN
203
+ } ) ;
183
204
expect ( credentials . invalidateTokenInvoked ) . to . be . false ;
184
205
} ) ;
185
206
@@ -191,7 +212,10 @@ describe('Datastore', () => {
191
212
const datastore = newDatastore ( credentials , connection , serializer ) ;
192
213
await expect ( invokeDatastoreImplInvokeStreamingRPC ( datastore ) )
193
214
. to . eventually . be . rejectedWith ( 'zzyzx' )
194
- . and . have . property ( 'code' , Code . UNAUTHENTICATED ) ;
215
+ . and . include ( {
216
+ 'name' : 'FirebaseError' ,
217
+ 'code' : Code . UNAUTHENTICATED
218
+ } ) ;
195
219
expect ( credentials . invalidateTokenInvoked ) . to . be . true ;
196
220
} ) ;
197
221
} ) ;
0 commit comments