@@ -505,3 +505,68 @@ test("Project with unknown extension dependency inline configuration", (t) => {
505505 return t . throws ( projectPreprocessor . processTree ( tree ) ,
506506 "Unknown extension type 'phony-pony' for extension.a" , "Rejected with error" ) ;
507507} ) ;
508+
509+ test ( "Project with task extension dependency" , ( t ) => {
510+ // "project-type" extension handling not yet implemented => test currently checks for error
511+ const tree = {
512+ id : "application.a" ,
513+ path : applicationAPath ,
514+ dependencies : [ {
515+ id : "ext.task.a" ,
516+ path : applicationAPath ,
517+ dependencies : [ ] ,
518+ version : "1.0.0" ,
519+ specVersion : "0.1" ,
520+ kind : "extension" ,
521+ type : "task" ,
522+ metadata : {
523+ name : "task.a"
524+ } ,
525+ task : {
526+ path : "task.a.js"
527+ }
528+ } ] ,
529+ version : "1.0.0" ,
530+ specVersion : "0.1" ,
531+ type : "application" ,
532+ metadata : {
533+ name : "xy"
534+ }
535+ } ;
536+ return projectPreprocessor . processTree ( tree ) . then ( ( parsedTree ) => {
537+ t . deepEqual ( parsedTree . dependencies . length , 0 , "Application project has no dependencies" ) ;
538+ const taskRepository = require ( "@ui5/builder" ) . tasks . taskRepository ;
539+ t . truthy ( taskRepository . getTask ( "task.a" ) , "task.a has been added to the task repository" ) ;
540+ } ) ;
541+ } ) ;
542+
543+ test ( "Project with task extension dependency - task module not found" , async ( t ) => {
544+ // "project-type" extension handling not yet implemented => test currently checks for error
545+ const tree = {
546+ id : "application.a" ,
547+ path : applicationAPath ,
548+ dependencies : [ {
549+ id : "ext.task.a" ,
550+ path : applicationAPath ,
551+ dependencies : [ ] ,
552+ version : "1.0.0" ,
553+ specVersion : "0.1" ,
554+ kind : "extension" ,
555+ type : "task" ,
556+ metadata : {
557+ name : "task.a"
558+ } ,
559+ task : {
560+ path : "task.not.existing.js"
561+ }
562+ } ] ,
563+ version : "1.0.0" ,
564+ specVersion : "0.1" ,
565+ type : "application" ,
566+ metadata : {
567+ name : "xy"
568+ }
569+ } ;
570+ const error = await t . throws ( projectPreprocessor . processTree ( tree ) ) ;
571+ t . regex ( error . message , / ^ C a n n o t f i n d m o d u l e .* / , "Rejected with error" ) ;
572+ } ) ;
0 commit comments