@@ -35,6 +35,7 @@ function makeStorage(url: string) {
35
35
function maker ( wrapper , loc ) {
36
36
return ( { } as any ) as Reference ;
37
37
}
38
+
38
39
const authWrapper = new AuthWrapper (
39
40
null ,
40
41
maker ,
@@ -56,14 +57,14 @@ describe('Firebase Storage > Reference', () => {
56
57
const s = makeStorage ( 'gs://test-bucket/this/ismyobject?hello' ) ;
57
58
assert . equal ( s . toString ( ) , 'gs://test-bucket/this/ismyobject?hello' ) ;
58
59
} ) ;
59
- it ( " doesn't URL-decode on a gs:// string" , ( ) => {
60
+ it ( ' doesn\ 't URL-decode on a gs:// string' , ( ) => {
60
61
const s = makeStorage ( 'gs://test-bucket/%3F' ) ;
61
62
assert . equal ( s . toString ( ) , 'gs://test-bucket/%3F' ) ;
62
63
} ) ;
63
64
it ( 'ignores URL params and fragments on an http URL' , ( ) => {
64
65
const s = makeStorage (
65
66
`http://${ DEFAULT_HOST } /v0/b/test-bucket/o/my/object.txt` +
66
- '?ignoreme#please'
67
+ '?ignoreme#please'
67
68
) ;
68
69
assert . equal ( s . toString ( ) , 'gs://test-bucket/my/object.txt' ) ;
69
70
} ) ;
@@ -77,7 +78,7 @@ describe('Firebase Storage > Reference', () => {
77
78
it ( 'ignores URL params and fragments on an https URL' , ( ) => {
78
79
const s = makeStorage (
79
80
`https://${ DEFAULT_HOST } /v0/b/test-bucket/o/my/object.txt` +
80
- '?ignoreme#please'
81
+ '?ignoreme#please'
81
82
) ;
82
83
assert . equal ( s . toString ( ) , 'gs://test-bucket/my/object.txt' ) ;
83
84
} ) ;
@@ -91,7 +92,7 @@ describe('Firebase Storage > Reference', () => {
91
92
} ) ;
92
93
93
94
describe ( 'toString' , ( ) => {
94
- it ( " Doesn't add trailing slash" , ( ) => {
95
+ it ( ' Doesn\ 't add trailing slash' , ( ) => {
95
96
const s = makeStorage ( 'gs://test-bucket/foo' ) ;
96
97
assert . equal ( s . toString ( ) , 'gs://test-bucket/foo' ) ;
97
98
} ) ;
@@ -176,7 +177,7 @@ describe('Firebase Storage > Reference', () => {
176
177
} ) ;
177
178
} ) ;
178
179
179
- it ( " Doesn't send Authorization on null auth token" , done => {
180
+ it ( ' Doesn\ 't send Authorization on null auth token' , done => {
180
181
function newSend (
181
182
xhrio : TestingXhrIo ,
182
183
url : string ,
@@ -301,7 +302,7 @@ describe('Firebase Storage > Reference', () => {
301
302
'storage/invalid-argument'
302
303
) ;
303
304
} ) ;
304
- it ( " doesn't throw on good metadata" , ( ) => {
305
+ it ( ' doesn\ 't throw on good metadata' , ( ) => {
305
306
const goodMetadata = {
306
307
md5Hash : 'a' ,
307
308
cacheControl : 'done' ,
@@ -396,6 +397,15 @@ describe('Firebase Storage > Reference', () => {
396
397
} ) ;
397
398
} ) ;
398
399
400
+ describe ( 'listAll' , ( ) => {
401
+ it ( 'throws on number arg' , ( ) => {
402
+ testShared . assertThrows (
403
+ testShared . bind ( child . listAll , child , 1 ) ,
404
+ 'storage/invalid-argument-count'
405
+ ) ;
406
+ } ) ;
407
+ } ) ;
408
+
399
409
describe ( 'list' , ( ) => {
400
410
it ( 'throws on invalid option' , ( ) => {
401
411
testShared . assertThrows (
@@ -479,14 +489,14 @@ describe('Firebase Storage > Reference', () => {
479
489
} ) ;
480
490
481
491
describe ( 'non-root operations' , ( ) => {
482
- it ( " put doesn't throw" , ( ) => {
492
+ it ( ' put doesn\ 't throw' , ( ) => {
483
493
assert . doesNotThrow ( ( ) => {
484
494
child . put ( new Blob ( [ 'a' ] ) ) ;
485
495
child . put ( new Uint8Array ( 10 ) ) ;
486
496
child . put ( new ArrayBuffer ( 10 ) ) ;
487
497
} ) ;
488
498
} ) ;
489
- it ( " putString doesn't throw" , ( ) => {
499
+ it ( ' putString doesn\ 't throw' , ( ) => {
490
500
assert . doesNotThrow ( ( ) => {
491
501
child . putString ( 'raw' , StringFormat . RAW ) ;
492
502
child . putString ( 'aaaa' , StringFormat . BASE64 ) ;
@@ -497,17 +507,22 @@ describe('Firebase Storage > Reference', () => {
497
507
) ;
498
508
} ) ;
499
509
} ) ;
500
- it ( " delete doesn't throw" , ( ) => {
510
+ it ( ' delete doesn\ 't throw' , ( ) => {
501
511
assert . doesNotThrow ( ( ) => {
502
512
child . delete ( ) ;
503
513
} ) ;
504
514
} ) ;
505
- it ( " getMetadata doesn't throw" , ( ) => {
515
+ it ( ' getMetadata doesn\ 't throw' , ( ) => {
506
516
assert . doesNotThrow ( ( ) => {
507
517
child . getMetadata ( ) ;
508
518
} ) ;
509
519
} ) ;
510
- it ( "list doesn't throw" , ( ) => {
520
+ it ( 'listAll doesn\'t throw' , ( ) => {
521
+ assert . doesNotThrow ( ( ) => {
522
+ child . listAll ( ) ;
523
+ } ) ;
524
+ } ) ;
525
+ it ( 'list doesn\'t throw' , ( ) => {
511
526
assert . doesNotThrow ( ( ) => {
512
527
child . list ( ) ;
513
528
} ) ;
@@ -520,13 +535,16 @@ describe('Firebase Storage > Reference', () => {
520
535
assert . doesNotThrow ( ( ) => {
521
536
child . list ( { maxResults : 4 } ) ;
522
537
} ) ;
538
+ assert . doesNotThrow ( ( ) => {
539
+ child . list ( { maxResults : 4 , pageToken : null } ) ;
540
+ } ) ;
523
541
} ) ;
524
- it ( " updateMetadata doesn't throw" , ( ) => {
542
+ it ( ' updateMetadata doesn\ 't throw' , ( ) => {
525
543
assert . doesNotThrow ( ( ) => {
526
544
child . updateMetadata ( { } as Metadata ) ;
527
545
} ) ;
528
546
} ) ;
529
- it ( " getDownloadURL doesn't throw" , ( ) => {
547
+ it ( ' getDownloadURL doesn\ 't throw' , ( ) => {
530
548
assert . doesNotThrow ( ( ) => {
531
549
child . getDownloadURL ( ) ;
532
550
} ) ;
@@ -558,12 +576,17 @@ describe('Firebase Storage > Reference', () => {
558
576
'storage/invalid-root-operation'
559
577
) ;
560
578
} ) ;
561
- it ( "list doesn't throws" , ( ) => {
579
+ it ( 'listAll doesn\ 't throws' , ( ) => {
562
580
assert . doesNotThrow ( ( ) => {
563
- child . list ( ) ;
581
+ root . listAll ( ) ;
564
582
} ) ;
583
+ } ) ;
584
+ it ( 'list doesn\'t throws' , ( ) => {
565
585
assert . doesNotThrow ( ( ) => {
566
- child . list ( { pageToken : 'xxx' , maxResults : 4 } ) ;
586
+ root . list ( ) ;
587
+ } ) ;
588
+ assert . doesNotThrow ( ( ) => {
589
+ root . list ( { pageToken : 'xxx' , maxResults : 4 } ) ;
567
590
} ) ;
568
591
} ) ;
569
592
it ( 'updateMetadata throws' , ( ) => {
0 commit comments