@@ -6,6 +6,7 @@ import {when} from 'jest-when';
66
77import { lift as liftJob } from '../job/index.js' ;
88import * as matrixVerificationJobEnhancer from './verify-matrix/index.js' ;
9+ import * as workflowResultJobEnhancer from './workflow-result/index.js' ;
910import insertMissingJob from './missing-job-inserter.js' ;
1011import buildNodeVersionMatrix from './node-version-matrix-builder.js' ;
1112import liftJobs from './lifter.js' ;
@@ -17,26 +18,29 @@ vi.mock('../job/index.js');
1718describe ( 'steps lifter' , ( ) => {
1819 it ( 'should lift the steps' , async ( ) => {
1920 const jobNames = any . listOf ( any . word ) ;
21+ const jobNamesWithMissingInjected = any . listOf ( any . word ) ;
2022 const jobDefinitions = jobNames . map ( any . simpleObject ) ;
21- const liftedJobDefinitions = jobDefinitions . map ( any . simpleObject ) ;
23+ const jobDefinitionsWithMissingInjected = jobNamesWithMissingInjected . map ( any . simpleObject ) ;
24+ const liftedJobDefinitions = jobDefinitionsWithMissingInjected . map ( any . simpleObject ) ;
2225 const supportedNodeVersionRange = any . string ( ) ;
2326 const supportedNodeVersions = any . listOf ( any . integer ) ;
24- const jobPairsWithMissingInjected = zip ( any . listOf ( any . word ) , any . listOf ( any . simpleObject ) ) ;
2527 const runner = any . word ( ) ;
28+ const jobs = Object . fromEntries ( zip ( jobNames , jobDefinitions ) ) ;
2629 when ( buildNodeVersionMatrix ) . calledWith ( supportedNodeVersionRange ) . mockReturnValue ( supportedNodeVersions ) ;
2730 when ( insertMissingJob )
28- . calledWith ( { versions : supportedNodeVersions , jobs : zip ( jobNames , liftedJobDefinitions ) , runner} )
29- . mockReturnValue ( jobPairsWithMissingInjected ) ;
30- zip ( jobDefinitions , liftedJobDefinitions , jobNames ) . forEach (
31+ . calledWith ( { versions : supportedNodeVersions , jobs : zip ( jobNames , jobDefinitions ) , runner} )
32+ . mockReturnValue ( zip ( jobNamesWithMissingInjected , jobDefinitionsWithMissingInjected ) ) ;
33+ zip ( jobDefinitionsWithMissingInjected , liftedJobDefinitions , jobNamesWithMissingInjected ) . forEach (
3134 ( [ job , liftedJob , jobName ] ) => when ( liftJob )
32- . calledWith ( [ jobName , job ] , [ matrixVerificationJobEnhancer ] , { inRangeNodeVersions : supportedNodeVersions } )
35+ . calledWith (
36+ [ jobName , job ] ,
37+ [ matrixVerificationJobEnhancer , workflowResultJobEnhancer ] ,
38+ { inRangeNodeVersions : supportedNodeVersions , jobs}
39+ )
3340 . mockReturnValue ( [ jobName , liftedJob ] )
3441 ) ;
3542
36- expect ( await liftJobs ( {
37- jobs : Object . fromEntries ( zip ( jobNames , jobDefinitions ) ) ,
38- engines : supportedNodeVersionRange ,
39- runner
40- } ) ) . toEqual ( Object . fromEntries ( jobPairsWithMissingInjected ) ) ;
43+ expect ( await liftJobs ( { jobs, engines : supportedNodeVersionRange , runner} ) )
44+ . toEqual ( Object . fromEntries ( zip ( jobNamesWithMissingInjected , liftedJobDefinitions ) ) ) ;
4145 } ) ;
4246} ) ;
0 commit comments