@@ -522,20 +522,23 @@ layer("GitLabPullRequestCli.layer", (it) => {
522522 ) ;
523523
524524 it . effect . each ( [
525- [ "the revert conflicts" , "/revert" ] ,
526- [ "opening the merge request fails" , "/merge_requests" ] ,
527- ] as const ) ( "deletes the revert branch when %s" , ( [ , failingPath ] ) =>
525+ [ "the revert conflicts" , "/revert" , "Failure" ] ,
526+ [ "opening the merge request fails" , "/merge_requests" , "Failure" ] ,
527+ [ "the request is interrupted" , "/revert" , "Interrupt" ] ,
528+ ] as const ) ( "deletes the revert branch when %s" , ( [ , failingPath , outcome ] ) =>
528529 Effect . gen ( function * ( ) {
529530 mockedExecute . mockImplementation ( ( { args, cwd } ) =>
530531 args [ 1 ] ?. endsWith ( failingPath ) && args . includes ( "POST" )
531- ? Effect . fail (
532- new GitLabCli . GitLabCliCommandError ( {
533- operation : "execute" ,
534- command : "glab" ,
535- cwd,
536- cause : new Error ( "GitLab rejected the write" ) ,
537- } ) ,
538- )
532+ ? outcome === "Interrupt"
533+ ? Effect . interrupt
534+ : Effect . fail (
535+ new GitLabCli . GitLabCliCommandError ( {
536+ operation : "execute" ,
537+ command : "glab" ,
538+ cwd,
539+ cause : new Error ( "GitLab rejected the write" ) ,
540+ } ) ,
541+ )
539542 : Effect . succeed (
540543 output (
541544 mergeRequestJson ( {
@@ -548,7 +551,7 @@ layer("GitLabPullRequestCli.layer", (it) => {
548551 ) ;
549552 const cli = yield * GitLabPullRequestCli . GitLabPullRequestCli ;
550553
551- const result = yield * Effect . result (
554+ const exit = yield * Effect . exit (
552555 cli . runMergeRequestAction ( {
553556 cwd : "/w" ,
554557 repository : "acme/web" ,
@@ -557,7 +560,7 @@ layer("GitLabPullRequestCli.layer", (it) => {
557560 } ) ,
558561 ) ;
559562
560- expect ( result ) . toMatchObject ( { _tag : "Failure" , failure : { _tag : "GitLabCliCommandError" } } ) ;
563+ expect ( exit . _tag ) . toBe ( "Failure" ) ;
561564 expect ( mockedExecute . mock . calls . at ( - 1 ) ?. [ 0 ] . args . slice ( 1 , 4 ) ) . toEqual ( [
562565 "projects/acme%2Fweb/repository/branches/revert-abc12345" ,
563566 "--method" ,
0 commit comments