@@ -71,12 +71,18 @@ function FSTest(): void {
7171 FS . init ( null , null , null ) ;
7272
7373 FS . mkdir ( "/working" ) ;
74+ FS . mkdirTree ( "/nested/directory/structure" ) ;
75+ FS . mkdirTree ( "/another/path" , parseInt ( "0755" , 8 ) ) ;
7476 FS . mount ( NODEFS , { root : "." } , "/working" ) ;
7577
7678 function myAppStartup ( ) : void {
7779 FS . mkdir ( "/data" ) ;
7880 FS . mount ( IDBFS , { } , "/data" ) ;
7981
82+ // Test isMountpoint - checks if a node is a mount point
83+ const testNode = FS . lookupPath ( "/data" , { } ) . node ;
84+ const isMount : boolean = FS . isMountpoint ( testNode ) ;
85+
8086 FS . syncfs ( true , ( err ) => {
8187 // handle callback
8288 } ) ;
@@ -92,6 +98,12 @@ function FSTest(): void {
9298 FS . registerDevice ( id , { } ) ;
9399 FS . mkdev ( "/dummy" , id ) ;
94100
101+ // Test createDevice - creates a device with input/output functions
102+ const inputDevice = FS . createDevice ( "/" , "stdin" , ( ) => 65 , undefined ) ; // Returns 'A' (65)
103+ const outputDevice = FS . createDevice ( "/" , "stdout" , undefined , ( c : number ) => console . log ( String . fromCharCode ( c ) ) ) ;
104+ const bothDevice = FS . createDevice ( "/" , "console" , ( ) => 66 , ( c : number ) => console . log ( c ) ) ; // Returns 'B' (66)
105+ const simpleDevice = FS . createDevice ( "/" , "null" ) ;
106+
95107 FS . writeFile ( "file" , "foobar" ) ;
96108 FS . symlink ( "file" , "link" ) ;
97109
@@ -119,7 +131,19 @@ function FSTest(): void {
119131 const data = new Uint8Array ( 32 ) ;
120132 const wstream = FS . open ( "dummy1" , "w+" ) ;
121133 FS . write ( wstream , data , 0 , data . length , 0 ) ;
122- FS . close ( wstream ) ;
134+
135+ // Test FS.open with numeric flags
136+ const numericWriteStream = FS . open ( "numeric-write-stream-test" , 1 ) ;
137+ FS . write ( numericWriteStream , data , 0 , data . length , 0 ) ;
138+ FS . close ( numericWriteStream ) ;
139+
140+ // Test getStream - gets stream by file descriptor
141+ const streamFromFD = FS . getStream ( wstream . fd ! ) ;
142+ // $ExpectType FSStream
143+ streamFromFD ;
144+
145+ // Test closeStream - closes stream by file descriptor
146+ FS . closeStream ( wstream . fd ! ) ;
123147
124148 FS . createDataFile ( "/" , "dummy2" , data , true , true , true ) ;
125149
0 commit comments