Skip to content

Commit

Permalink
Update default temp test directory
Browse files Browse the repository at this point in the history
  • Loading branch information
dsagal committed Nov 5, 2024
1 parent e7fc79b commit 10f844c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/test/testutil.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from 'fs/promises';
import {tmpdir} from 'os';
import path from 'path';
import * as chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
Expand All @@ -14,11 +15,11 @@ import 'mocha';
import 'source-map-support/register';

/**
* Create test directory named suiteName under process.env.TESTDIR, defaulting to ./_testoutputs.
* Create test directory named suiteName under process.env.TESTDIR, defaulting to tmpdir().
* Hard-deletes any directory already there.
*/
export async function createTestDir(suiteName: string): Promise<string> {
const tmpRootDir = process.env.TESTDIR || "./_testoutputs";
const tmpRootDir = process.env.TESTDIR || tmpdir();
const testDir = path.join(tmpRootDir, suiteName);
// Remove any previous tmp dir, and create the new one.
await fs.rm(testDir, {force: true, recursive: true});
Expand Down

0 comments on commit 10f844c

Please sign in to comment.