From db4529d893679ffbea4fdf5a8c7bc020b8e8b56e Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 12 Aug 2026 20:26:05 -0700 Subject: [PATCH] test(cli): use tracked profile temp directory --- src/commands/doctor/shared/pristine-startup-state.test.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/commands/doctor/shared/pristine-startup-state.test.ts b/src/commands/doctor/shared/pristine-startup-state.test.ts index c0df600b7a4c..c319933024f9 100644 --- a/src/commands/doctor/shared/pristine-startup-state.test.ts +++ b/src/commands/doctor/shared/pristine-startup-state.test.ts @@ -2,6 +2,7 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; import { afterEach, describe, expect, it } from "vitest"; +import { useAutoCleanupTempDirTracker } from "../../../../test/helpers/temp-dir.js"; import { canSkipPristineStartupStateMigrations, planPristineStartupConfigMigrations, @@ -9,6 +10,7 @@ import { } from "./pristine-startup-state.js"; const roots: string[] = []; +const tempDirs = useAutoCleanupTempDirTracker(afterEach); function createFixture(config: Record, stateEntries: string[] = []) { const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pristine-startup-")); @@ -107,8 +109,7 @@ afterEach(() => { describe("pristine startup state", () => { it("accepts a missing explicitly selected profile root", () => { - const root = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-pristine-profile-")); - roots.push(root); + const root = tempDirs.make("openclaw-pristine-profile-"); const stateDir = path.join(root, ".openclaw-typo"); fs.mkdirSync(path.join(root, ".clawdbot"));