test(config): reuse shared temp dir helper in store read tests

This commit is contained in:
Vincent Koc
2026-04-06 06:36:30 +01:00
parent 7846492686
commit 8b8c9d4356

View File

@@ -1,12 +1,12 @@
import fs from "node:fs/promises";
import path from "node:path";
import { describe, expect, it } from "vitest";
import { withTempDir } from "../../test-utils/temp-dir.js";
import { withTempDir } from "../../test-helpers/temp-dir.js";
import { readSessionStoreReadOnly } from "./store-read.js";
describe("readSessionStoreReadOnly", () => {
it("returns an empty store for malformed or non-object JSON", async () => {
await withTempDir("openclaw-session-store-", async (dir) => {
await withTempDir({ prefix: "openclaw-session-store-" }, async (dir) => {
const storePath = path.join(dir, "sessions.json");
await fs.writeFile(storePath, '["not-an-object"]\n', "utf8");