File tree Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Expand file tree Collapse file tree 2 files changed +15
-9
lines changed Original file line number Diff line number Diff line change 5252 "screwdriver-data-schema" : " ^25.0.0" ,
5353 "screwdriver-logger" : " ^3.0.0" ,
5454 "screwdriver-request" : " ^3.0.0" ,
55- "screwdriver-scm-base" : " ^10.0.0 "
55+ "screwdriver-scm-base" : " ^10.0.1 "
5656 }
5757}
Original file line number Diff line number Diff line change @@ -533,22 +533,28 @@ describe('index', function () {
533533 } ) ;
534534 } ) ;
535535
536- it ( 'rejects if fails ' , ( ) => {
536+ it ( 'resolves with author with default values for the optional fields when there is a failure ' , ( ) => {
537537 const err = new Error ( 'Bitbucket API error' ) ;
538+ const username = '{4f1a9b7f-586e-4e80-b9eb-a7589b4a165f}' ;
538539
539540 requestMock . rejects ( err ) ;
540541
541542 return scm
542543 . decorateAuthor ( {
543- username : '{4f1a9b7f-586e-4e80-b9eb-a7589b4a165f}' ,
544+ username,
544545 token
545546 } )
546- . then ( ( ) => {
547- assert . fail ( 'Should not get here' ) ;
548- } )
549- . catch ( error => {
550- assert . calledWith ( requestMock , expectedOptions ) ;
551- assert . equal ( error , err ) ;
547+ . then ( author => {
548+ assert . deepEqual (
549+ {
550+ id : '' ,
551+ avatar : 'https://cd.screwdriver.cd/assets/unknown_user.png' ,
552+ name : username ,
553+ username,
554+ url : 'https://cd.screwdriver.cd/'
555+ } ,
556+ author
557+ ) ;
552558 } ) ;
553559 } ) ;
554560 } ) ;
You can’t perform that action at this time.
0 commit comments