@@ -11,8 +11,12 @@ describe('chmod', () => {
1111 mfs = await createMfs ( )
1212 } )
1313
14+ after ( async ( ) => {
15+ await mfs . repo . close ( )
16+ } )
17+
1418 async function testChmod ( initialMode , modification , expectedFinalMode ) {
15- const path = `/foo-${ Date . now ( ) } `
19+ const path = `/foo-${ Math . random ( ) } `
1620
1721 await mfs . write ( path , Buffer . from ( 'Hello world' ) , {
1822 create : true ,
@@ -28,7 +32,7 @@ describe('chmod', () => {
2832 }
2933
3034 it ( 'should update the mode for a file' , async ( ) => {
31- const path = `/foo-${ Date . now ( ) } `
35+ const path = `/foo-${ Math . random ( ) } `
3236
3337 await mfs . write ( path , Buffer . from ( 'Hello world' ) , {
3438 create : true ,
@@ -45,7 +49,7 @@ describe('chmod', () => {
4549 } )
4650
4751 it ( 'should update the mode for a directory' , async ( ) => {
48- const path = `/foo-${ Date . now ( ) } `
52+ const path = `/foo-${ Math . random ( ) } `
4953
5054 await mfs . mkdir ( path )
5155 const originalMode = ( await mfs . stat ( path ) ) . mode
@@ -59,7 +63,7 @@ describe('chmod', () => {
5963 } )
6064
6165 it ( 'should update the mode for a hamt-sharded-directory' , async ( ) => {
62- const path = `/foo-${ Date . now ( ) } `
66+ const path = `/foo-${ Math . random ( ) } `
6367
6468 await mfs . mkdir ( path )
6569 await mfs . write ( `${ path } /foo.txt` , Buffer . from ( 'Hello world' ) , {
@@ -160,7 +164,7 @@ describe('chmod', () => {
160164 } )
161165
162166 it ( 'should apply special execute permissions to world' , async ( ) => {
163- const path = `/foo-${ Date . now ( ) } `
167+ const path = `/foo-${ Math . random ( ) } `
164168 const sub = `${ path } /sub`
165169 const file = `${ path } /sub/foo.txt`
166170 const bin = `${ path } /sub/bar`
@@ -197,7 +201,7 @@ describe('chmod', () => {
197201 } )
198202
199203 it ( 'should apply special execute permissions to user' , async ( ) => {
200- const path = `/foo-${ Date . now ( ) } `
204+ const path = `/foo-${ Math . random ( ) } `
201205 const sub = `${ path } /sub`
202206 const file = `${ path } /sub/foo.txt`
203207 const bin = `${ path } /sub/bar`
@@ -234,7 +238,7 @@ describe('chmod', () => {
234238 } )
235239
236240 it ( 'should apply special execute permissions to user and group' , async ( ) => {
237- const path = `/foo-${ Date . now ( ) } `
241+ const path = `/foo-${ Math . random ( ) } `
238242 const sub = `${ path } /sub`
239243 const file = `${ path } /sub/foo.txt`
240244 const bin = `${ path } /sub/bar`
@@ -271,7 +275,7 @@ describe('chmod', () => {
271275 } )
272276
273277 it ( 'should apply special execute permissions to sharded directories' , async ( ) => {
274- const path = `/foo-${ Date . now ( ) } `
278+ const path = `/foo-${ Math . random ( ) } `
275279 const sub = `${ path } /sub`
276280 const file = `${ path } /sub/foo.txt`
277281 const bin = `${ path } /sub/bar`
0 commit comments