From 611e229af90cb77cfa1b155b784cbe7fce5cbdf3 Mon Sep 17 00:00:00 2001 From: Do Siki Date: Sun, 23 Aug 2026 10:23:00 +0200 Subject: [PATCH] test(cms): clean up all partner-logo test artifacts --- scripts/test-content-editor-logo.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/test-content-editor-logo.js b/scripts/test-content-editor-logo.js index 0f66b9e..b4a3c1e 100644 --- a/scripts/test-content-editor-logo.js +++ b/scripts/test-content-editor-logo.js @@ -166,8 +166,10 @@ async function main() { assert.ok(tBody.path.startsWith('/partners/'), 'traversal name is sanitized to a safe slug'); assert.ok(!tBody.path.includes('..'), 'no traversal in the returned path'); } finally { - try { fs.unlinkSync(partnerFile); } catch { /* noop */ } - try { fs.rmdirSync(partnerDir); } catch { /* not empty */ } + try { + for (const f of fs.readdirSync(partnerDir)) fs.unlinkSync(path.join(partnerDir, f)); + fs.rmdirSync(partnerDir); + } catch { /* best effort */ } } console.log('Content Editor logo upload test: OK');