@@ -721,6 +721,114 @@ test.serial("ProjectBuild status (end): Task execution not started", (t) => {
721721 t . is ( stderrWriteStub . callCount , 0 , "Logged zero messages" ) ;
722722} ) ;
723723
724+ test . serial ( "ProjectBuild status (skip)" , ( t ) => {
725+ const { stderrWriteStub} = t . context ;
726+ process . emit ( "ui5.build-metadata" , {
727+ projectsToBuild : [ "project.a" ]
728+ } ) ;
729+
730+ process . emit ( "ui5.project-build-metadata" , {
731+ projectName : "project.a" ,
732+ projectType : "project-type" ,
733+ tasksToRun : [ "task.a" ]
734+ } ) ;
735+
736+ process . emit ( "ui5.project-build-status" , {
737+ level : "info" ,
738+ projectName : "project.a" ,
739+ projectType : "project-type" ,
740+ taskName : "task.a" ,
741+ status : "task-skip" ,
742+ } ) ;
743+
744+ t . is ( stderrWriteStub . callCount , 1 , "Logged one message" ) ;
745+ t . is ( stripAnsi ( stderrWriteStub . getCall ( 0 ) . args [ 0 ] ) ,
746+ `info project.a ${ figures . tick } Skipping task task.a\n` ,
747+ "Logged expected message" ) ;
748+ } ) ;
749+
750+ test . serial ( "ProjectBuild status (skip): Task execution already started" , ( t ) => {
751+ const { stderrWriteStub} = t . context ;
752+ process . emit ( "ui5.build-metadata" , {
753+ projectsToBuild : [ "project.a" ]
754+ } ) ;
755+
756+ process . emit ( "ui5.project-build-metadata" , {
757+ projectName : "project.a" ,
758+ projectType : "project-type" ,
759+ tasksToRun : [ "task.a" ]
760+ } ) ;
761+
762+ process . emit ( "ui5.project-build-status" , {
763+ level : "silly" ,
764+ projectName : "project.a" ,
765+ projectType : "project-type" ,
766+ taskName : "task.a" ,
767+ status : "task-start" ,
768+ } ) ;
769+
770+ t . throws ( ( ) => {
771+ process . emit ( "ui5.project-build-status" , {
772+ level : "info" ,
773+ projectName : "project.a" ,
774+ projectType : "project-type" ,
775+ taskName : "task.a" ,
776+ status : "task-skip" ,
777+ } ) ;
778+ } , {
779+ message :
780+ "writers/Console: Unexpected task-skip event for project project.a, task task.a. " +
781+ "Task execution already started"
782+ } ) ;
783+
784+ t . is ( stderrWriteStub . callCount , 0 , "Logged zero messages" ) ;
785+ } ) ;
786+
787+ test . serial ( "ProjectBuild status (skip): Task execution already ended" , ( t ) => {
788+ const { stderrWriteStub} = t . context ;
789+ process . emit ( "ui5.build-metadata" , {
790+ projectsToBuild : [ "project.a" ]
791+ } ) ;
792+
793+ process . emit ( "ui5.project-build-metadata" , {
794+ projectName : "project.a" ,
795+ projectType : "project-type" ,
796+ tasksToRun : [ "task.a" ]
797+ } ) ;
798+
799+ process . emit ( "ui5.project-build-status" , {
800+ level : "silly" ,
801+ projectName : "project.a" ,
802+ projectType : "project-type" ,
803+ taskName : "task.a" ,
804+ status : "task-start" ,
805+ } ) ;
806+
807+ process . emit ( "ui5.project-build-status" , {
808+ level : "silly" ,
809+ projectName : "project.a" ,
810+ projectType : "project-type" ,
811+ taskName : "task.a" ,
812+ status : "task-end" ,
813+ } ) ;
814+
815+ t . throws ( ( ) => {
816+ process . emit ( "ui5.project-build-status" , {
817+ level : "info" ,
818+ projectName : "project.a" ,
819+ projectType : "project-type" ,
820+ taskName : "task.a" ,
821+ status : "task-skip" ,
822+ } ) ;
823+ } , {
824+ message :
825+ "writers/Console: Unexpected task-skip event for project project.a, task task.a. " +
826+ "Task execution already ended"
827+ } ) ;
828+
829+ t . is ( stderrWriteStub . callCount , 0 , "Logged zero messages" ) ;
830+ } ) ;
831+
724832test . serial ( "ProjectBuild status: Unknown status" , ( t ) => {
725833 const { stderrWriteStub} = t . context ;
726834 process . emit ( "ui5.build-metadata" , {
0 commit comments