Skip to content

Commit f03da24

Browse files
committed
updated test case for deletefile function
1 parent 4023f6b commit f03da24

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/Lighthouse/tests/deleteFile.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ describe('deleteFile', () => {
66
const fileId = process.env.TEST_FILE_ID as string
77

88
it('should delete a file with correct API key and file ID', async () => {
9-
const res = await lighthouse.deleteFile(apiKey, fileId)
9+
const uploadsRes = await lighthouse.getUploads(apiKey)
10+
const fileList = uploadsRes.data.fileList
11+
expect(fileList.length).toBeGreaterThan(0)
12+
13+
const firstFileId = fileList[0].id
14+
expect(typeof firstFileId).toBe('string')
15+
16+
const res = await lighthouse.deleteFile(apiKey, firstFileId)
1017
expect(res.data.message).toBe('File deleted successfully.')
1118
}, 60000)
1219

0 commit comments

Comments
 (0)