32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
console.log
|
|
[FileCleanup] Cleaning up old file: /uploads/test/old-image.png
|
|
|
|
at Proxy.delegate.update (src/prisma/file-cleanup.helper.ts:49:25)
|
|
|
|
FAIL test/file-cleanup.spec.ts
|
|
File Cleanup Middleware
|
|
× should delete old file when user image is updated (995 ms)
|
|
|
|
● File Cleanup Middleware › should delete old file when user image is updated
|
|
|
|
expect(received).toBe(expected) // Object.is equality
|
|
|
|
Expected: false
|
|
Received: true
|
|
|
|
69 | // 5. Verify old file is gone
|
|
70 | const fileExists = fs.existsSync(oldFilePath);
|
|
> 71 | expect(fileExists).toBe(false);
|
|
| ^
|
|
72 |
|
|
73 | // 6. Verify File record is gone
|
|
74 | const fileRecord = await prisma.file.findFirst({
|
|
|
|
at Object.<anonymous> (test/file-cleanup.spec.ts:71:24)
|
|
|
|
Test Suites: 1 failed, 1 total
|
|
Tests: 1 failed, 1 total
|
|
Snapshots: 0 total
|
|
Time: 1.754 s, estimated 2 s
|
|
Ran all test suites matching test/file-cleanup.spec.ts.
|