mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-03 01:50:22 +00:00
test(config): reuse shared temp dir helper in store read tests
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user