@@ -122,9 +122,9 @@ describe("node fs-bridge", () => {
122122 const files = await bridge . listdir ( "" ) ;
123123 expect ( files ) . toHaveLength ( 3 ) ;
124124 expect ( files ) . toEqual ( [
125- { type : "file" , name : "file1.txt" , path : "file1.txt" } ,
126- { type : "file" , name : "file2.txt" , path : "file2.txt" } ,
127- { type : "directory" , name : "subdir" , path : "subdir" , children : [ ] } ,
125+ { type : "file" , name : "file1.txt" , path : "/ file1.txt" } ,
126+ { type : "file" , name : "file2.txt" , path : "/ file2.txt" } ,
127+ { type : "directory" , name : "subdir" , path : "/ subdir/ " , children : [ ] } ,
128128 ] ) ;
129129 } ) ;
130130
@@ -148,9 +148,9 @@ describe("node fs-bridge", () => {
148148
149149 expect ( flattened ) . toHaveLength ( 3 ) ;
150150 expect ( flattened ) . toEqual ( [
151- "dir/deep/file.txt" ,
152- "dir/nested.txt" ,
153- "root.txt" ,
151+ "/ dir/deep/file.txt" ,
152+ "/ dir/nested.txt" ,
153+ "/ root.txt" ,
154154 ] ) ;
155155 expect ( files . map ( ( f ) => f . name ) ) . toContain ( "root.txt" ) ;
156156 } ) ;
@@ -310,7 +310,7 @@ describe("node fs-bridge", () => {
310310 expect ( files [ 0 ] ) . toEqual ( {
311311 type : "file" ,
312312 name : "nested.txt" ,
313- path : "nested.txt" ,
313+ path : "/ nested.txt" ,
314314 } ) ;
315315 } ) ;
316316
@@ -436,7 +436,7 @@ describe("node fs-bridge", () => {
436436 expect ( file ) . toEqual ( {
437437 type : "file" ,
438438 name : "file.txt" ,
439- path : "file.txt" ,
439+ path : "/ file.txt" ,
440440 } ) ;
441441 // Ensure no extra properties
442442 expect ( Object . keys ( file ! ) ) . toEqual ( [ "type" , "name" , "path" ] ) ;
@@ -457,7 +457,7 @@ describe("node fs-bridge", () => {
457457 expect ( dir ) . toEqual ( {
458458 type : "directory" ,
459459 name : "subdir" ,
460- path : "subdir" ,
460+ path : "/ subdir/ " ,
461461 children : [ ] , // Non-recursive should have empty children
462462 } ) ;
463463 // Ensure children is always an array for directories
@@ -489,7 +489,7 @@ describe("node fs-bridge", () => {
489489 expect ( childFile ) . toEqual ( {
490490 type : "file" ,
491491 name : "child.txt" ,
492- path : "parent/child.txt" ,
492+ path : "/ parent/child.txt" ,
493493 } ) ;
494494
495495 const nestedDir = parent . children . find ( ( c ) => c . name === "nested" ) ;
@@ -499,7 +499,7 @@ describe("node fs-bridge", () => {
499499 expect ( nestedDir . children [ 0 ] ) . toEqual ( {
500500 type : "file" ,
501501 name : "deep.txt" ,
502- path : "parent/nested/deep.txt" ,
502+ path : "/ parent/nested/deep.txt" ,
503503 } ) ;
504504 }
505505 }
@@ -605,11 +605,11 @@ describe("node fs-bridge", () => {
605605 const rootFiles = await bridge . listdir ( "." ) ;
606606 expect ( rootFiles ) . toHaveLength ( 5 ) ;
607607 expect ( rootFiles ) . toEqual ( expect . arrayContaining ( [
608- { type : "file" , name : "README.md" , path : "README.md" } ,
609- { type : "directory" , name : "docs" , path : "docs" , children : [ ] } ,
610- { type : "file" , name : "package.json" , path : "package.json" } ,
611- { type : "directory" , name : "src" , path : "src" , children : [ ] } ,
612- { type : "directory" , name : "tests" , path : "tests" , children : [ ] } ,
608+ { type : "file" , name : "README.md" , path : "/ README.md" } ,
609+ { type : "directory" , name : "docs" , path : "/ docs/ " , children : [ ] } ,
610+ { type : "file" , name : "package.json" , path : "/ package.json" } ,
611+ { type : "directory" , name : "src" , path : "/ src/ " , children : [ ] } ,
612+ { type : "directory" , name : "tests" , path : "/ tests/ " , children : [ ] } ,
613613 ] ) ) ;
614614
615615 // verify file contents
@@ -649,8 +649,8 @@ describe("node fs-bridge", () => {
649649
650650 const flattenedPosts = flattenFilePaths ( posts ) ;
651651 expect ( flattenedPosts ) . toHaveLength ( 2 ) ;
652- expect ( flattenedPosts ) . toContain ( "2024/first-post.md" ) ;
653- expect ( flattenedPosts ) . toContain ( "2024/second-post.md" ) ;
652+ expect ( flattenedPosts ) . toContain ( "/ 2024/first-post.md" ) ;
653+ expect ( flattenedPosts ) . toContain ( "/ 2024/second-post.md" ) ;
654654
655655 // move draft to published
656656 const draftContent = await bridge . read ( "drafts/upcoming.md" ) ;
0 commit comments