@@ -13,36 +13,21 @@ const vfs = require('node:vfs');
1313 assert . strictEqual ( myVfs . mountPointURL , null ) ;
1414}
1515
16- // Test: file: URL of the mount point while mounted, null again after
17- // unmounting.
16+ // Test: file: URL string of the mount point while mounted, null again
17+ // after unmounting.
1818{
1919 const myVfs = vfs . create ( ) ;
2020 const mountPoint = myVfs . mount ( ) ;
2121
2222 const url = myVfs . mountPointURL ;
23- assert . ok ( url instanceof URL ) ;
24- assert . strictEqual ( url . protocol , 'file:' ) ;
25- assert . strictEqual ( url . href , pathToFileURL ( mountPoint ) . href ) ;
23+ assert . strictEqual ( typeof url , 'string' ) ;
24+ assert . ok ( url . startsWith ( 'file:' ) ) ;
25+ assert . strictEqual ( url , pathToFileURL ( mountPoint ) . href ) ;
2626
2727 myVfs . unmount ( ) ;
2828 assert . strictEqual ( myVfs . mountPointURL , null ) ;
2929}
3030
31- // Test: each access returns a fresh URL object, so callers mutating the
32- // result cannot corrupt the instance state.
33- {
34- const myVfs = vfs . create ( ) ;
35- myVfs . mount ( ) ;
36-
37- const first = myVfs . mountPointURL ;
38- first . pathname += '/tampered' ;
39- const second = myVfs . mountPointURL ;
40- assert . notStrictEqual ( first , second ) ;
41- assert . strictEqual ( second . href , pathToFileURL ( myVfs . mountPoint ) . href ) ;
42-
43- myVfs . unmount ( ) ;
44- }
45-
4631// Test: the URL is usable to address files in the mounted VFS.
4732{
4833 const myVfs = vfs . create ( ) ;
0 commit comments