@@ -361,31 +361,31 @@ describe('S3Adapter tests', () => {
361
361
362
362
it ( 'should get using the baseUrl' , async ( ) => {
363
363
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
364
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
364
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
365
365
'http://example.com/files/foo/bar/test.png'
366
366
) ;
367
367
} ) ;
368
368
369
369
it ( 'should get direct to baseUrl' , async ( ) => {
370
370
options . baseUrlDirect = true ;
371
371
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
372
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
372
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
373
373
'http://example.com/files/test.png'
374
374
) ;
375
375
} ) ;
376
376
377
377
it ( 'should get without directAccess' , async ( ) => {
378
378
options . directAccess = false ;
379
379
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
380
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
380
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
381
381
'http://my.server.com/parse/files/xxxx/test.png'
382
382
) ;
383
383
} ) ;
384
384
385
385
it ( 'should go directly to amazon' , async ( ) => {
386
386
delete options . baseUrl ;
387
387
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
388
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
388
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
389
389
'https://my-bucket.s3.amazonaws.com/foo/bar/test.png'
390
390
) ;
391
391
} ) ;
@@ -412,31 +412,31 @@ describe('S3Adapter tests', () => {
412
412
413
413
it ( 'should get using the baseUrl' , async ( ) => {
414
414
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
415
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
415
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
416
416
'http://example.com/files/foo/bar/test.png'
417
417
) ;
418
418
} ) ;
419
419
420
420
it ( 'should get direct to baseUrl' , async ( ) => {
421
421
options . baseUrlDirect = true ;
422
422
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
423
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
423
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
424
424
'http://example.com/files/test.png'
425
425
) ;
426
426
} ) ;
427
427
428
428
it ( 'should get without directAccess' , async ( ) => {
429
429
options . directAccess = false ;
430
430
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
431
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
431
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
432
432
'http://my.server.com/parse/files/xxxx/test.png'
433
433
) ;
434
434
} ) ;
435
435
436
436
it ( 'should go directly to amazon' , async ( ) => {
437
437
delete options . baseUrl ;
438
438
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
439
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
439
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
440
440
'https://my-bucket.s3.amazonaws.com/foo/bar/test.png'
441
441
) ;
442
442
} ) ;
@@ -459,7 +459,7 @@ describe('S3Adapter tests', () => {
459
459
460
460
it ( 'should get using the baseUrl' , async ( ) => {
461
461
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
462
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
462
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
463
463
'http://example.com/files/foo/bar/test.png'
464
464
) ;
465
465
} ) ;
@@ -496,23 +496,23 @@ describe('S3Adapter tests', () => {
496
496
it ( 'should get direct to baseUrl' , async ( ) => {
497
497
options . baseUrlDirect = true ;
498
498
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
499
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
499
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
500
500
'http://example.com/files/test.png'
501
501
) ;
502
502
} ) ;
503
503
504
504
it ( 'should get without directAccess' , async ( ) => {
505
505
options . directAccess = false ;
506
506
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
507
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
507
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
508
508
'http://my.server.com/parse/files/xxxx/test.png'
509
509
) ;
510
510
} ) ;
511
511
512
512
it ( 'should go directly to amazon' , async ( ) => {
513
513
delete options . baseUrl ;
514
514
const s3 = new S3Adapter ( 'accessKey' , 'secretKey' , 'my-bucket' , options ) ;
515
- expect ( await s3 . getFileLocation ( testConfig , 'test.png' ) ) . toEqual (
515
+ await expectAsync ( s3 . getFileLocation ( testConfig , 'test.png' ) ) . toBeResolvedTo (
516
516
'https://my-bucket.s3.amazonaws.com/foo/bar/test.png'
517
517
) ;
518
518
} ) ;
0 commit comments