From fc24c3372d2563a043df47de38dd6cf4b2e92b38 Mon Sep 17 00:00:00 2001 From: Francesco Trotta Date: Sun, 18 Feb 2024 21:21:10 +0100 Subject: [PATCH] delete temporary test directories --- tests/lib/release-ops.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/lib/release-ops.js b/tests/lib/release-ops.js index dcbbc70..197b947 100644 --- a/tests/lib/release-ops.js +++ b/tests/lib/release-ops.js @@ -487,11 +487,11 @@ describe("ReleaseOps", () => { const cwd = process.cwd(); let sandbox = null; + let tmpDir = null; beforeEach(() => { sandbox = sinon.sandbox.create(); - const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "writeChangelog-")); - + tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "writeChangelog-")); process.chdir(tmpDir); }); @@ -499,6 +499,9 @@ describe("ReleaseOps", () => { sandbox.restore(); sandbox = null; process.chdir(cwd); + fs.readdirSync(tmpDir).forEach(filename => fs.unlinkSync(path.join(tmpDir, filename))); // delete files in tmpDir + fs.rmdirSync(tmpDir); + tmpDir = null; }); it("creates a changelog", () => {