File tree 2 files changed +11
-2
lines changed
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,15 @@ describe("distribution", () => {
169
169
} ) ;
170
170
expect ( nock . isDone ( ) ) . to . be . true ;
171
171
} ) ;
172
+
173
+ it ( "should gracefully handle no testers" , async ( ) => {
174
+ nock ( appDistributionOrigin ( ) ) . get ( `/v1/${ projectName } /testers` ) . reply ( 200 , { } ) ;
175
+
176
+ await expect ( appDistributionClient . listTesters ( projectName ) ) . to . eventually . deep . eq ( {
177
+ testers : [ ] ,
178
+ } ) ;
179
+ expect ( nock . isDone ( ) ) . to . be . true ;
180
+ } ) ;
172
181
} ) ;
173
182
174
183
describe ( "uploadRelease" , ( ) => {
Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ export class AppDistributionClient {
152
152
throw new FirebaseError ( `Client request failed to list testers ${ err } ` ) ;
153
153
}
154
154
155
- for ( const t of apiResponse . body . testers ) {
155
+ for ( const t of apiResponse . body . testers ?? [ ] ) {
156
156
listTestersResponse . testers . push ( {
157
157
name : t . name ,
158
158
displayName : t . displayName ,
@@ -212,7 +212,7 @@ export class AppDistributionClient {
212
212
const apiResponse = await client . get < ListGroupsResponse > ( `${ projectName } /groups` , {
213
213
queryParams,
214
214
} ) ;
215
- listGroupsResponse . groups . push ( ...( apiResponse . body . groups || [ ] ) ) ;
215
+ listGroupsResponse . groups . push ( ...( apiResponse . body . groups ?? [ ] ) ) ;
216
216
pageToken = apiResponse . body . nextPageToken ;
217
217
} catch ( err ) {
218
218
throw new FirebaseError ( `Client failed to list groups ${ err } ` ) ;
You can’t perform that action at this time.
0 commit comments