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');