diff --git a/backend/tests/unit/imageRotation.test.ts b/backend/tests/unit/imageRotation.test.ts index a42c0ce..5c35a33 100644 --- a/backend/tests/unit/imageRotation.test.ts +++ b/backend/tests/unit/imageRotation.test.ts @@ -4,6 +4,13 @@ import path from 'path'; import sharp from 'sharp'; import { rotateInPlace } from '../../src/imageProcessing'; +// libvips keeps an input file mapped in its operation cache after a pipeline +// finishes, and Windows will not delete a file that still has an open handle — +// so the animated-WebP case, which is the one that ends in a rejection, left +// afterEach unable to remove its own temporary directory. Disabling the cache +// costs these six tests nothing: every one of them reads its file exactly once. +sharp.cache(false); + let dir = ''; beforeEach(async () => {