Skip to content

Commit

Permalink
delete temporary test directories
Browse files Browse the repository at this point in the history
  • Loading branch information
fasttime committed Feb 18, 2024
1 parent d25ced9 commit fc24c33
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tests/lib/release-ops.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,18 +487,21 @@ 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);
});

afterEach(() => {
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", () => {
Expand Down

0 comments on commit fc24c33

Please sign in to comment.