feat: Implement file cleanup middleware for automatic old file deletion using local and Cloudinary storage providers.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
FAIL test/file-cleanup.spec.ts
|
||||
File Cleanup Middleware
|
||||
× should delete old file when user image is updated (3 ms)
|
||||
|
||||
● File Cleanup Middleware › should delete old file when user image is updated
|
||||
|
||||
TypeError: prisma.$use is not a function
|
||||
|
||||
16 | beforeAll(async () => {
|
||||
17 | prisma = new PrismaClient();
|
||||
> 18 | (prisma as any).$use(fileCleanupMiddleware(prisma));
|
||||
| ^
|
||||
19 | await prisma.$connect();
|
||||
20 |
|
||||
21 | if (!fs.existsSync(testDir)) {
|
||||
|
||||
at Object.<anonymous> (test/file-cleanup.spec.ts:18:21)
|
||||
|
||||
Test Suites: 1 failed, 1 total
|
||||
Tests: 1 failed, 1 total
|
||||
Snapshots: 0 total
|
||||
Time: 0.657 s, estimated 1 s
|
||||
Ran all test suites matching test/file-cleanup.spec.ts.
|
||||
Reference in New Issue
Block a user