@@ -10,10 +10,24 @@ describe('workflow-result job lifter', () => {
1010 expect ( liftWorkflowResultJob ( existingJobDetails , { jobs : any . simpleObject ( ) } ) ) . toEqual ( existingJobDetails ) ;
1111 } ) ;
1212
13- it ( 'should make the job depend on the `verify-matrix` job if it exists ' , ( ) => {
13+ it ( 'should include the required dependencies if no existing needs are defined ' , ( ) => {
1414 expect ( liftWorkflowResultJob (
1515 existingJobDetails ,
16- { jobs : { ... any . simpleObject ( ) , 'verify-matrix' : any . simpleObject ( ) } }
16+ { jobs : { 'verify-matrix' : { } } }
1717 ) ) . toEqual ( { ...existingJobDetails , needs : [ 'verify' , 'verify-matrix' ] } ) ;
1818 } ) ;
19+
20+ it ( 'should update scaffolded needs to include verify-matrix' , ( ) => {
21+ expect ( liftWorkflowResultJob (
22+ { ...existingJobDetails , needs : [ 'verify' ] } ,
23+ { jobs : { 'verify-matrix' : { } } }
24+ ) ) . toEqual ( { ...existingJobDetails , needs : [ 'verify' , 'verify-matrix' ] } ) ;
25+ } ) ;
26+
27+ it ( 'should keep existing needs and append missing required dependencies' , ( ) => {
28+ expect ( liftWorkflowResultJob (
29+ { ...existingJobDetails , needs : [ 'existing-dependency' ] } ,
30+ { jobs : { 'verify-matrix' : { } } }
31+ ) ) . toEqual ( { ...existingJobDetails , needs : [ 'existing-dependency' , 'verify' , 'verify-matrix' ] } ) ;
32+ } ) ;
1933} ) ;
0 commit comments