@@ -173,130 +173,145 @@ describe('functions()', function () {
173
173
174
174
describe ( 'HttpsError' , function ( ) {
175
175
it ( 'errors return instance of HttpsError' , async function ( ) {
176
- const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
176
+ if ( device . getPlatform ( ) !== 'ios' ) {
177
+ const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
178
+
179
+ try {
180
+ await functionRunner ( { } ) ;
181
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
182
+ } catch ( e ) {
183
+ should . equal ( e . details , null ) ;
184
+ e . code . should . equal ( 'invalid-argument' ) ;
185
+ e . message . should . equal ( 'Invalid test requested.' ) ;
186
+ }
177
187
178
- try {
179
- await functionRunner ( { } ) ;
180
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
181
- } catch ( e ) {
182
- should . equal ( e . details , null ) ;
183
- e . code . should . equal ( 'invalid-argument' ) ;
184
- e . message . should . equal ( 'Invalid test requested.' ) ;
188
+ return Promise . resolve ( ) ;
189
+ } else {
190
+ // TODO waiting on firebase-ios-sdk > 9.1.0 - https://github.com/firebase/firebase-ios-sdk/pull/9862
191
+ this . skip ( ) ;
185
192
}
186
-
187
- return Promise . resolve ( ) ;
188
193
} ) ;
189
194
190
195
it ( 'HttpsError.details -> allows returning complex data' , async function ( ) {
191
- let type = 'deepObject' ;
192
- let inputData = SAMPLE_DATA [ type ] ;
193
- const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
194
- try {
195
- await functionRunner ( {
196
- type,
197
- inputData,
198
- asError : true ,
199
- } ) ;
200
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
201
- } catch ( e ) {
202
- should . deepEqual ( e . details , inputData ) ;
203
- e . code . should . equal ( 'cancelled' ) ;
204
- e . message . should . equal (
205
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
206
- ) ;
207
- }
196
+ if ( device . getPlatform ( ) !== 'ios' ) {
197
+ let type = 'deepObject' ;
198
+ let inputData = SAMPLE_DATA [ type ] ;
199
+ const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
200
+ try {
201
+ await functionRunner ( {
202
+ type,
203
+ inputData,
204
+ asError : true ,
205
+ } ) ;
206
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
207
+ } catch ( e ) {
208
+ should . deepEqual ( e . details , inputData ) ;
209
+ e . code . should . equal ( 'cancelled' ) ;
210
+ e . message . should . equal (
211
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
212
+ ) ;
213
+ }
214
+
215
+ type = 'deepArray' ;
216
+ inputData = SAMPLE_DATA [ type ] ;
217
+ try {
218
+ await functionRunner ( {
219
+ type,
220
+ inputData,
221
+ asError : true ,
222
+ } ) ;
223
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
224
+ } catch ( e ) {
225
+ should . deepEqual ( e . details , inputData ) ;
226
+ e . code . should . equal ( 'cancelled' ) ;
227
+ e . message . should . equal (
228
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
229
+ ) ;
230
+ }
208
231
209
- type = 'deepArray' ;
210
- inputData = SAMPLE_DATA [ type ] ;
211
- try {
212
- await functionRunner ( {
213
- type,
214
- inputData,
215
- asError : true ,
216
- } ) ;
217
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
218
- } catch ( e ) {
219
- should . deepEqual ( e . details , inputData ) ;
220
- e . code . should . equal ( 'cancelled' ) ;
221
- e . message . should . equal (
222
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
223
- ) ;
232
+ return Promise . resolve ( ) ;
233
+ } else {
234
+ // TODO waiting on firebase-ios-sdk > 9.1.0 - https://github.com/firebase/firebase-ios-sdk/pull/9862
235
+ this . skip ( ) ;
224
236
}
225
-
226
- return Promise . resolve ( ) ;
227
237
} ) ;
228
238
229
239
it ( 'HttpsError.details -> allows returning primitives' , async function ( ) {
230
- let type = 'number' ;
231
- let inputData = SAMPLE_DATA [ type ] ;
232
- const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
233
- try {
234
- await functionRunner ( {
235
- type,
236
- inputData,
237
- asError : true ,
238
- } ) ;
239
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
240
- } catch ( e ) {
241
- e . code . should . equal ( 'cancelled' ) ;
242
- e . message . should . equal (
243
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
244
- ) ;
245
- should . deepEqual ( e . details , inputData ) ;
246
- }
247
-
248
- type = 'string' ;
249
- inputData = SAMPLE_DATA [ type ] ;
250
- try {
251
- await functionRunner ( {
252
- type,
253
- inputData,
254
- asError : true ,
255
- } ) ;
256
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
257
- } catch ( e ) {
258
- should . deepEqual ( e . details , inputData ) ;
259
- e . code . should . equal ( 'cancelled' ) ;
260
- e . message . should . equal (
261
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
262
- ) ;
263
- }
240
+ if ( device . getPlatform ( ) !== 'ios' ) {
241
+ let type = 'number' ;
242
+ let inputData = SAMPLE_DATA [ type ] ;
243
+ const functionRunner = firebase . functions ( ) . httpsCallable ( 'testFunctionDefaultRegion' ) ;
244
+ try {
245
+ await functionRunner ( {
246
+ type,
247
+ inputData,
248
+ asError : true ,
249
+ } ) ;
250
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
251
+ } catch ( e ) {
252
+ e . code . should . equal ( 'cancelled' ) ;
253
+ e . message . should . equal (
254
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
255
+ ) ;
256
+ should . deepEqual ( e . details , inputData ) ;
257
+ }
258
+
259
+ type = 'string' ;
260
+ inputData = SAMPLE_DATA [ type ] ;
261
+ try {
262
+ await functionRunner ( {
263
+ type,
264
+ inputData,
265
+ asError : true ,
266
+ } ) ;
267
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
268
+ } catch ( e ) {
269
+ should . deepEqual ( e . details , inputData ) ;
270
+ e . code . should . equal ( 'cancelled' ) ;
271
+ e . message . should . equal (
272
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
273
+ ) ;
274
+ }
275
+
276
+ type = 'boolean' ;
277
+ inputData = SAMPLE_DATA [ type ] ;
278
+ try {
279
+ await functionRunner ( {
280
+ type,
281
+ inputData,
282
+ asError : true ,
283
+ } ) ;
284
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
285
+ } catch ( e ) {
286
+ should . deepEqual ( e . details , inputData ) ;
287
+ e . code . should . equal ( 'cancelled' ) ;
288
+ e . message . should . equal (
289
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
290
+ ) ;
291
+ }
292
+
293
+ type = 'null' ;
294
+ inputData = SAMPLE_DATA [ type ] ;
295
+ try {
296
+ await functionRunner ( {
297
+ type,
298
+ inputData,
299
+ asError : true ,
300
+ } ) ;
301
+ return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
302
+ } catch ( e ) {
303
+ should . deepEqual ( e . details , inputData ) ;
304
+ e . code . should . equal ( 'cancelled' ) ;
305
+ e . message . should . equal (
306
+ 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
307
+ ) ;
308
+ }
264
309
265
- type = 'boolean' ;
266
- inputData = SAMPLE_DATA [ type ] ;
267
- try {
268
- await functionRunner ( {
269
- type,
270
- inputData,
271
- asError : true ,
272
- } ) ;
273
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
274
- } catch ( e ) {
275
- should . deepEqual ( e . details , inputData ) ;
276
- e . code . should . equal ( 'cancelled' ) ;
277
- e . message . should . equal (
278
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
279
- ) ;
280
- }
281
-
282
- type = 'null' ;
283
- inputData = SAMPLE_DATA [ type ] ;
284
- try {
285
- await functionRunner ( {
286
- type,
287
- inputData,
288
- asError : true ,
289
- } ) ;
290
- return Promise . reject ( new Error ( 'Function did not reject with error.' ) ) ;
291
- } catch ( e ) {
292
- should . deepEqual ( e . details , inputData ) ;
293
- e . code . should . equal ( 'cancelled' ) ;
294
- e . message . should . equal (
295
- 'Response data was requested to be sent as part of an Error payload, so here we are!' ,
296
- ) ;
310
+ return Promise . resolve ( ) ;
311
+ } else {
312
+ // TODO waiting on firebase-ios-sdk > 9.1.0 - https://github.com/firebase/firebase-ios-sdk/pull/9862
313
+ this . skip ( ) ;
297
314
}
298
-
299
- return Promise . resolve ( ) ;
300
315
} ) ;
301
316
302
317
it ( 'HttpsCallableOptions.timeout will error when timeout is exceeded' , async function ( ) {
0 commit comments