chore: remove plans and uploads from git tracking
@@ -14,19 +14,18 @@ describe('persistMultipartImages with eager mode', () => {
|
||||
await fs.promises.unlink(path.join(UPLOADS_DIR, file)).catch(() => {})
|
||||
}
|
||||
}
|
||||
const cacheDir = path.join(UPLOADS_DIR, '.cache')
|
||||
await fs.promises.rm(cacheDir, { recursive: true, force: true }).catch(() => {})
|
||||
})
|
||||
|
||||
it('returns WebP URLs when eager=true', async () => {
|
||||
const sharp = (await import('sharp')).default
|
||||
const testImagePath = path.join(UPLOADS_DIR, `${TEST_PREFIX}original.png`)
|
||||
|
||||
const filesBefore = await fs.promises.readdir(UPLOADS_DIR)
|
||||
|
||||
await sharp({ create: { width: 100, height: 100, channels: 3, background: { r: 255, g: 0, b: 0 } } })
|
||||
.png()
|
||||
.toFile(testImagePath)
|
||||
|
||||
const filesBefore = await fs.promises.readdir(UPLOADS_DIR)
|
||||
|
||||
const mockRequest = {
|
||||
isMultipart: () => true,
|
||||
parts: async function* () {
|
||||
@@ -51,7 +50,13 @@ describe('persistMultipartImages with eager mode', () => {
|
||||
|
||||
// Verify the intermediate PNG file written by persistMultipartImages was deleted
|
||||
const filesAfter = await fs.promises.readdir(UPLOADS_DIR)
|
||||
const newPngFiles = filesAfter.filter((f) => !filesBefore.includes(f) && f.endsWith('.png'))
|
||||
const newPngFiles = filesAfter.filter(
|
||||
(f) =>
|
||||
!filesBefore.includes(f) &&
|
||||
f.endsWith('.png') &&
|
||||
f !== path.basename(testImagePath) &&
|
||||
!f.startsWith('test-eager-uuid-'),
|
||||
)
|
||||
expect(newPngFiles).toHaveLength(0)
|
||||
})
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 81 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 35 KiB |
|
Before Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 165 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 31 KiB |
|
Before Width: | Height: | Size: 13 KiB |
@@ -1 +0,0 @@
|
||||
|
||||
|
Before Width: | Height: | Size: 1.7 MiB |
|
Before Width: | Height: | Size: 1.2 MiB |
|
Before Width: | Height: | Size: 13 MiB |
|
Before Width: | Height: | Size: 1.0 MiB |
|
Before Width: | Height: | Size: 1.9 MiB |
|
Before Width: | Height: | Size: 15 MiB |
|
Before Width: | Height: | Size: 13 MiB |
|
Before Width: | Height: | Size: 13 MiB |
|
Before Width: | Height: | Size: 1.8 MiB |
|
Before Width: | Height: | Size: 1.1 MiB |