Skip to content
This repository was archived by the owner on Jul 6, 2025. It is now read-only.

Commit 4e0fec6

Browse files
Craig DoremusCraig Doremus
authored andcommitted
add-test-redirect Fixed failing tests
1 parent 3cdf548 commit 4e0fec6

File tree

1 file changed

+6
-19
lines changed

1 file changed

+6
-19
lines changed

shared/fs_test.ts

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
} from './fs.ts'
99

1010

11-
Deno.test(`fs existsDirSync`, () => {
11+
Deno.test(`fs: existsDirSync`, () => {
1212
// true test cases
1313
const dir = Deno.makeTempDirSync()
1414
assert(existsDirSync(dir))
@@ -22,7 +22,7 @@ Deno.test(`fs existsDirSync`, () => {
2222
})
2323

2424

25-
Deno.test(`fs async existsDir`, async () => {
25+
Deno.test(`fs: async existsDir`, async () => {
2626
// true test cases
2727
assert(await existsDir(await Deno.realPath(getStandardFolder())))
2828
const dir = await Deno.makeTempDir()
@@ -31,13 +31,9 @@ Deno.test(`fs async existsDir`, async () => {
3131
assertEquals(await existsDir(`${dir}${SEP}foobar`), false)
3232
const file = await Deno.makeTempFile()
3333
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))
3834
})
3935

40-
Deno.test(`fs existsFileSync`, () => {
36+
Deno.test(`fs: existsFileSync`, () => {
4137
// true test cases
4238
const file = Deno.makeTempFileSync()
4339
assert(existsFileSync(file))
@@ -49,21 +45,17 @@ Deno.test(`fs existsFileSync`, () => {
4945
assertThrows(() => existsDirSync({} as string), Error)
5046
})
5147

52-
Deno.test(`fs async existsFile`, async () => {
48+
Deno.test(`fs: async existsFile`, async () => {
5349
// true test cases
5450
const file = await Deno.makeTempFile()
5551
assert(await existsFile(file))
5652
// false test cases
5753
const dir = Deno.makeTempDirSync()
5854
assertEquals(await existsFile(dir), false)
5955
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))
6456
})
6557

66-
Deno.test('ensureTextFile', async () => {
58+
Deno.test('fs: ensureTextFile', async () => {
6759
// true test case
6860
const dirPath = await Deno.makeTempDir()
6961
const textFilePath = `${dirPath}${SEP}test.txt`
@@ -84,7 +76,7 @@ Deno.test('ensureTextFile', async () => {
8476
}
8577
})
8678

87-
Deno.test('lazyRemove', async () => {
79+
Deno.test('fs: lazyRemove', async () => {
8880
// true test case
8981
const filePath = await Deno.makeTempFile()
9082
await lazyRemove(filePath)
@@ -93,11 +85,6 @@ Deno.test('lazyRemove', async () => {
9385
const dirPath = await Deno.makeTempDir()
9486
await lazyRemove(`${dirPath}${SEP}asdfsdf.txt`)
9587
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-
10188
})
10289

10390

0 commit comments

Comments
 (0)