@@ -2,15 +2,16 @@ import type { HardhatRuntimeEnvironment } from "../../../../src/types/hre.js";
2
2
import type repl from "node:repl" ;
3
3
4
4
import assert from "node:assert/strict" ;
5
- import fsPromises from "node:fs/promises" ;
6
- import os from "node:os" ;
7
5
import path from "node:path" ;
8
6
import { PassThrough } from "node:stream" ;
9
7
import { afterEach , before , beforeEach , describe , it } from "node:test" ;
10
8
11
9
import { ensureError } from "@ignored/hardhat-vnext-utils/error" ;
12
10
import { exists , remove } from "@ignored/hardhat-vnext-utils/fs" ;
13
- import { useFixtureProject } from "@nomicfoundation/hardhat-test-utils" ;
11
+ import {
12
+ getTmpDir ,
13
+ useFixtureProject ,
14
+ } from "@nomicfoundation/hardhat-test-utils" ;
14
15
import debug from "debug" ;
15
16
16
17
import consoleAction from "../../../../src/internal/builtin-plugins/console/task-action.js" ;
@@ -145,12 +146,9 @@ describe("console/task-action", function () {
145
146
let history : string ;
146
147
147
148
beforeEach ( async function ( ) {
148
- // TODO(#5601): Use the mkdtemp from hardhat-utils once it's available
149
149
// We use a temporary cache dir to avoid conflicts with other tests
150
150
// and global user settings.
151
- cacheDir = await fsPromises . mkdtemp (
152
- path . resolve ( os . tmpdir ( ) , "console-action-test-" ) ,
153
- ) ;
151
+ cacheDir = await getTmpDir ( "console-action-test" ) ;
154
152
history = path . resolve ( cacheDir , "console-history.txt" ) ;
155
153
} ) ;
156
154
0 commit comments