@@ -12,9 +12,10 @@ const projectCache = {};
1212 *
1313 * @param {string[] } names e.g. ["lib", "a"]
1414 * @param {string } [version="3.0.0-<library name>"] Project version
15+ * @param {string } [type="library"] Project type
1516 * @returns {object } Project mock
1617 */
17- const createProjectMetadata = ( names , version ) => {
18+ const createProjectMetadata = ( names , version , type ) => {
1819 const key = names . join ( "." ) ;
1920
2021 // Cache projects in order to return same object instance
@@ -26,11 +27,11 @@ const createProjectMetadata = (names, version) => {
2627 return projectCache [ key ] = {
2728 getName : ( ) => key ,
2829 getNamespace : ( ) => names . join ( "/" ) ,
29- getVersion : ( ) => version || "3.0.0-" + key
30+ getVersion : ( ) => version || "3.0.0-" + key ,
31+ getType : ( ) => type || "library"
3032 } ;
3133} ;
3234
33-
3435function createWorkspace ( ) {
3536 return resourceFactory . createAdapter ( {
3637 virBasePath : "/" ,
@@ -42,9 +43,9 @@ function createDependencies(oOptions = {
4243 virBasePath : "/resources/" ,
4344 fsBasePath : path . join ( __dirname , ".." , ".." , "fixtures" , "sap.ui.core-evo" , "main" , "src" )
4445} ) {
45- oOptions = Object . assign ( oOptions , {
46+ oOptions = Object . assign ( {
4647 project : createProjectMetadata ( [ "test" , "lib3" ] , "3.0.0" )
47- } ) ;
48+ } , oOptions ) ;
4849 return resourceFactory . createAdapter ( oOptions ) ;
4950}
5051
@@ -246,9 +247,9 @@ const createResources = async (dependencies, resourceFactory, names, deps, embed
246247function createDepWorkspace ( names , oOptions = {
247248 virBasePath : "/resources"
248249} ) {
249- oOptions = Object . assign ( oOptions , {
250+ oOptions = Object . assign ( {
250251 project : createProjectMetadata ( names )
251- } ) ;
252+ } , oOptions ) ;
252253 return resourceFactory . createAdapter ( oOptions ) ;
253254}
254255
@@ -1146,3 +1147,38 @@ test.serial("integration: Library with manifest with invalid dependency", async
11461147 "This might prevent some UI5 runtime performance optimizations from taking effect. " +
11471148 "Please double check your project's dependency configuration." ) ;
11481149} ) ;
1150+
1151+ test . serial ( "integration: Library of type 'module'" , async ( t ) => {
1152+ const { infoLogStub} = t . context ;
1153+ const workspace = createWorkspace ( ) ;
1154+
1155+ await createDotLibrary ( workspace , resourceFactory , [ "test" , "lib" ] ) ;
1156+
1157+ // dependencies
1158+ const dependencies = createDepWorkspace ( [ "module" , "x" ] , {
1159+ virBasePath : "/" ,
1160+ project : createProjectMetadata ( [ "module" , "x" ] , "1.0.0" , "module" )
1161+ } ) ;
1162+
1163+ // lib.a
1164+ await createResources ( dependencies , resourceFactory , [ "module" , "x" ] , [ { name : "non.existing" } ] ) ;
1165+
1166+
1167+ const oOptions = {
1168+ options : {
1169+ projectName : "Test Lib" ,
1170+ pattern : "/resources/**/.library" ,
1171+ rootProject : createProjectMetadata ( [ "myname" ] , "1.33.7" )
1172+ } ,
1173+ workspace,
1174+ dependencies
1175+ } ;
1176+ await assertCreatedVersionInfo ( t , {
1177+ "name" : "myname" ,
1178+ "scmRevision" : "" ,
1179+ "version" : "1.33.7" ,
1180+ "libraries" : [ ] ,
1181+ } , oOptions ) ;
1182+
1183+ t . is ( infoLogStub . callCount , 0 ) ;
1184+ } ) ;
0 commit comments