@@ -224,7 +224,6 @@ test("Virtual RL: GLOB resources from application.a w/o virtual base path prefix
224224
225225test ( "Virtual RL: GLOB virtual directory w/o virtual base path prefix" , ( t ) => {
226226 // TODO: Add similar test (globbing on empty directory) for FS RL
227- // TODO: Also add tests for nodir: true option
228227 const readerWriter = ui5Fs . resourceFactory . createAdapter ( {
229228 virBasePath : "/app/"
230229 } ) ;
@@ -240,7 +239,6 @@ test("Virtual RL: GLOB virtual directory w/o virtual base path prefix", (t) => {
240239
241240test ( "Virtual RL: GLOB virtual directory w/ virtual base path prefix" , ( t ) => {
242241 // TODO: Add similar test (globbing on empty directory) for FS RL
243- // TODO: Also add tests for nodir: true option
244242 const readerWriter = ui5Fs . resourceFactory . createAdapter ( {
245243 virBasePath : "/app/one/two/"
246244 } ) ;
@@ -254,6 +252,34 @@ test("Virtual RL: GLOB virtual directory w/ virtual base path prefix", (t) => {
254252 ) ;
255253} ) ;
256254
255+ test ( "Virtual RL: GLOB virtual directory w/o virtual base path prefix and nodir: true" , ( t ) => {
256+ const readerWriter = ui5Fs . resourceFactory . createAdapter ( {
257+ virBasePath : "/app/"
258+ } ) ;
259+
260+ // Get resource from one readerWriter
261+ return t . notThrows (
262+ readerWriter . byGlob ( "/*" , { nodir : true } )
263+ . then ( ( resources ) => {
264+ t . deepEqual ( resources . length , 0 , "Found exactly one resource" ) ;
265+ } )
266+ ) ;
267+ } ) ;
268+
269+ test ( "Virtual RL: GLOB virtual directory w/ virtual base path prefix and nodir: true" , ( t ) => {
270+ const readerWriter = ui5Fs . resourceFactory . createAdapter ( {
271+ virBasePath : "/app/one/two/"
272+ } ) ;
273+
274+ // Get resource from one readerWriter
275+ return t . notThrows (
276+ readerWriter . byGlob ( "/*" , { nodir : true } )
277+ . then ( ( resources ) => {
278+ t . deepEqual ( resources . length , 0 , "Found exactly one resource" ) ;
279+ } )
280+ ) ;
281+ } ) ;
282+
257283test ( "createCollectionsForTree" , ( t ) => {
258284 // Creates resource reader collections for a given tree
259285 const resourceReaders = ui5Fs . resourceFactory . createCollectionsForTree ( applicationBTree ) ;
0 commit comments