@@ -16,25 +16,21 @@ test.before(async t => {
1616 AWS . mock ( "S3" , "getObject" , ( params , callback ) => {
1717 switch ( params . Key ) {
1818 case "processed.jpg" :
19- callback ( null , { Metadata : { "img-processed" : "true" } , CacheControl : "cache-control" } ) ;
20- break ;
19+ return callback ( null , { Metadata : { "img-processed" : "true" } , CacheControl : "cache-control" } ) ;
2120 case "empty-file.jpg" :
22- callback ( null , { ContentLength : 0 , Metadata : { } , CacheControl : "cache-control" } ) ;
23- break ;
21+ return callback ( null , { ContentLength : 0 , Metadata : { } , CacheControl : "cache-control" } ) ;
2422 case "network-error.jpg" :
25- callback ( "Simulated network error" ) ;
26- break ;
23+ return callback ( "Simulated network error" ) ;
2724 default :
28- callback ( null , { Body : fixture , Metadata : { } , CacheControl : "cache-control" } ) ;
25+ return callback ( null , { Body : fixture , Metadata : { } , CacheControl : "cache-control" } ) ;
2926 }
3027 } ) ;
3128 AWS . mock ( "S3" , "putObject" , ( params , callback ) => {
3229 switch ( params . Key ) {
3330 case "network-error.jpg" :
34- callback ( "Simulated network error" ) ;
35- break ;
31+ return callback ( "Simulated network error" ) ;
3632 default :
37- callback ( null ) ;
33+ return callback ( null ) ;
3834 }
3935 } ) ;
4036
@@ -85,7 +81,7 @@ test("Push valid ImageData object to S3", async t => {
8581
8682 const response = await fileSystem . putObject ( image ) ;
8783 t . is ( response , "S3 putObject success" )
88- } )
84+ } ) ;
8985
9086test ( "Fail on network error while pushing ImageData object to S3" , async t => {
9187 const image = new ImageData ( "network-error.jpg" , "fixture" , fixture , { } , "private" ) ;
@@ -95,4 +91,4 @@ test("Fail on network error while pushing ImageData object to S3", async t => {
9591 } , ( reason ) => {
9692 t . is ( reason , "Simulated network error" )
9793 } )
98- } )
94+ } ) ;
0 commit comments