@@ -8,9 +8,14 @@ describe('Volume File Operations', () => {
88 const path = '/test.txt'
99 const content = 'Hello, World!'
1010
11- await volume . writeFile ( path , content )
12- const readContent = await volume . readFile ( path , { format : 'text' } )
11+ const stat = await volume . writeFile ( path , content )
12+ expect ( stat . name ) . toBe ( 'test.txt' )
13+ expect ( stat . type ) . toBe ( 'file' )
14+ expect ( stat . path ) . toBe ( path )
15+ expect ( stat . mtime ) . toBeInstanceOf ( Date )
16+ expect ( stat . ctime ) . toBeInstanceOf ( Date )
1317
18+ const readContent = await volume . readFile ( path , { format : 'text' } )
1419 expect ( readContent ) . toBe ( content )
1520 } )
1621
@@ -73,17 +78,16 @@ describe('Volume File Operations', () => {
7378 const path = '/metadata.txt'
7479 const content = 'File with metadata'
7580
76- await volume . writeFile ( path , content , {
81+ const stat = await volume . writeFile ( path , content , {
7782 uid : 1000 ,
7883 gid : 1000 ,
7984 mode : 0o644 ,
8085 } )
8186
82- const entryInfo = await volume . getInfo ( path )
83- expect ( entryInfo . type ) . toBe ( 'file' )
84- expect ( entryInfo . uid ) . toBe ( 1000 )
85- expect ( entryInfo . gid ) . toBe ( 1000 )
86- expect ( entryInfo . mode ) . toBe ( 0o644 )
87+ expect ( stat . type ) . toBe ( 'file' )
88+ expect ( stat . uid ) . toBe ( 1000 )
89+ expect ( stat . gid ) . toBe ( 1000 )
90+ expect ( stat . mode ) . toBe ( 0o644 )
8791 }
8892 )
8993
0 commit comments