@@ -11,8 +11,12 @@ describe('chmod', () => {
11
11
mfs = await createMfs ( )
12
12
} )
13
13
14
+ after ( async ( ) => {
15
+ await mfs . repo . close ( )
16
+ } )
17
+
14
18
async function testChmod ( initialMode , modification , expectedFinalMode ) {
15
- const path = `/foo-${ Date . now ( ) } `
19
+ const path = `/foo-${ Math . random ( ) } `
16
20
17
21
await mfs . write ( path , Buffer . from ( 'Hello world' ) , {
18
22
create : true ,
@@ -28,7 +32,7 @@ describe('chmod', () => {
28
32
}
29
33
30
34
it ( 'should update the mode for a file' , async ( ) => {
31
- const path = `/foo-${ Date . now ( ) } `
35
+ const path = `/foo-${ Math . random ( ) } `
32
36
33
37
await mfs . write ( path , Buffer . from ( 'Hello world' ) , {
34
38
create : true ,
@@ -45,7 +49,7 @@ describe('chmod', () => {
45
49
} )
46
50
47
51
it ( 'should update the mode for a directory' , async ( ) => {
48
- const path = `/foo-${ Date . now ( ) } `
52
+ const path = `/foo-${ Math . random ( ) } `
49
53
50
54
await mfs . mkdir ( path )
51
55
const originalMode = ( await mfs . stat ( path ) ) . mode
@@ -59,7 +63,7 @@ describe('chmod', () => {
59
63
} )
60
64
61
65
it ( 'should update the mode for a hamt-sharded-directory' , async ( ) => {
62
- const path = `/foo-${ Date . now ( ) } `
66
+ const path = `/foo-${ Math . random ( ) } `
63
67
64
68
await mfs . mkdir ( path )
65
69
await mfs . write ( `${ path } /foo.txt` , Buffer . from ( 'Hello world' ) , {
@@ -160,7 +164,7 @@ describe('chmod', () => {
160
164
} )
161
165
162
166
it ( 'should apply special execute permissions to world' , async ( ) => {
163
- const path = `/foo-${ Date . now ( ) } `
167
+ const path = `/foo-${ Math . random ( ) } `
164
168
const sub = `${ path } /sub`
165
169
const file = `${ path } /sub/foo.txt`
166
170
const bin = `${ path } /sub/bar`
@@ -197,7 +201,7 @@ describe('chmod', () => {
197
201
} )
198
202
199
203
it ( 'should apply special execute permissions to user' , async ( ) => {
200
- const path = `/foo-${ Date . now ( ) } `
204
+ const path = `/foo-${ Math . random ( ) } `
201
205
const sub = `${ path } /sub`
202
206
const file = `${ path } /sub/foo.txt`
203
207
const bin = `${ path } /sub/bar`
@@ -234,7 +238,7 @@ describe('chmod', () => {
234
238
} )
235
239
236
240
it ( 'should apply special execute permissions to user and group' , async ( ) => {
237
- const path = `/foo-${ Date . now ( ) } `
241
+ const path = `/foo-${ Math . random ( ) } `
238
242
const sub = `${ path } /sub`
239
243
const file = `${ path } /sub/foo.txt`
240
244
const bin = `${ path } /sub/bar`
@@ -271,7 +275,7 @@ describe('chmod', () => {
271
275
} )
272
276
273
277
it ( 'should apply special execute permissions to sharded directories' , async ( ) => {
274
- const path = `/foo-${ Date . now ( ) } `
278
+ const path = `/foo-${ Math . random ( ) } `
275
279
const sub = `${ path } /sub`
276
280
const file = `${ path } /sub/foo.txt`
277
281
const bin = `${ path } /sub/bar`
0 commit comments