8
8
} from './fs.ts'
9
9
10
10
11
- Deno . test ( `fs existsDirSync` , ( ) => {
11
+ Deno . test ( `fs: existsDirSync` , ( ) => {
12
12
// true test cases
13
13
const dir = Deno . makeTempDirSync ( )
14
14
assert ( existsDirSync ( dir ) )
@@ -22,7 +22,7 @@ Deno.test(`fs existsDirSync`, () => {
22
22
} )
23
23
24
24
25
- Deno . test ( `fs async existsDir` , async ( ) => {
25
+ Deno . test ( `fs: async existsDir` , async ( ) => {
26
26
// true test cases
27
27
assert ( await existsDir ( await Deno . realPath ( getStandardFolder ( ) ) ) )
28
28
const dir = await Deno . makeTempDir ( )
@@ -31,13 +31,9 @@ Deno.test(`fs async existsDir`, async () => {
31
31
assertEquals ( await existsDir ( `${ dir } ${ SEP } foobar` ) , false )
32
32
const file = await Deno . makeTempFile ( )
33
33
assertEquals ( await existsDir ( file ) , false )
34
- // error test cases
35
- existsDir ( { } as string ) . then ( err => {
36
- assert ( err instanceof Error )
37
- } ) . catch ( e => console . error ( e ) )
38
34
} )
39
35
40
- Deno . test ( `fs existsFileSync` , ( ) => {
36
+ Deno . test ( `fs: existsFileSync` , ( ) => {
41
37
// true test cases
42
38
const file = Deno . makeTempFileSync ( )
43
39
assert ( existsFileSync ( file ) )
@@ -49,21 +45,17 @@ Deno.test(`fs existsFileSync`, () => {
49
45
assertThrows ( ( ) => existsDirSync ( { } as string ) , Error )
50
46
} )
51
47
52
- Deno . test ( `fs async existsFile` , async ( ) => {
48
+ Deno . test ( `fs: async existsFile` , async ( ) => {
53
49
// true test cases
54
50
const file = await Deno . makeTempFile ( )
55
51
assert ( await existsFile ( file ) )
56
52
// false test cases
57
53
const dir = Deno . makeTempDirSync ( )
58
54
assertEquals ( await existsFile ( dir ) , false )
59
55
assertEquals ( await existsFileSync ( `${ dir } ${ SEP } llksdafzxc.ts` ) , false )
60
- // error test cases
61
- existsFile ( { } as string ) . then ( err => {
62
- assert ( err instanceof Error )
63
- } ) . catch ( e => console . error ( e ) )
64
56
} )
65
57
66
- Deno . test ( 'ensureTextFile' , async ( ) => {
58
+ Deno . test ( 'fs: ensureTextFile' , async ( ) => {
67
59
// true test case
68
60
const dirPath = await Deno . makeTempDir ( )
69
61
const textFilePath = `${ dirPath } ${ SEP } test.txt`
@@ -84,7 +76,7 @@ Deno.test('ensureTextFile', async () => {
84
76
}
85
77
} )
86
78
87
- Deno . test ( 'lazyRemove' , async ( ) => {
79
+ Deno . test ( 'fs: lazyRemove' , async ( ) => {
88
80
// true test case
89
81
const filePath = await Deno . makeTempFile ( )
90
82
await lazyRemove ( filePath )
@@ -93,11 +85,6 @@ Deno.test('lazyRemove', async () => {
93
85
const dirPath = await Deno . makeTempDir ( )
94
86
await lazyRemove ( `${ dirPath } ${ SEP } asdfsdf.txt` )
95
87
assert ( await existsDir ( dirPath ) )
96
- // error test
97
- lazyRemove ( { } as string ) . then ( err => {
98
- assert ( err instanceof Error )
99
- } ) . catch ( e => console . error ( e ) )
100
-
101
88
} )
102
89
103
90
0 commit comments