test(core): trim redundant test resets and use mockClear

This commit is contained in:
Peter Steinberger
2026-02-22 08:12:55 +00:00
parent e893157600
commit d6d73d0ed9
15 changed files with 14 additions and 16 deletions

View File

@@ -17,7 +17,7 @@ describe("noteSessionLockHealth", () => {
let envSnapshot: ReturnType<typeof captureEnv>;
beforeEach(async () => {
note.mockReset();
note.mockClear();
envSnapshot = captureEnv(["OPENCLAW_STATE_DIR"]);
root = await fs.mkdtemp(path.join(os.tmpdir(), "openclaw-doctor-locks-"));
process.env.OPENCLAW_STATE_DIR = root;

View File

@@ -77,7 +77,7 @@ describe("doctor state integrity oauth dir checks", () => {
process.env.OPENCLAW_STATE_DIR = path.join(tempHome, ".openclaw");
delete process.env.OPENCLAW_OAUTH_DIR;
fs.mkdirSync(process.env.OPENCLAW_STATE_DIR, { recursive: true, mode: 0o700 });
vi.mocked(note).mockReset();
vi.mocked(note).mockClear();
});
afterEach(() => {