import fs from "node:fs/promises"; import path from "node:path"; import { describe, expect, it } from "vitest"; import {
restoreStateDirEnv,
setStateDirEnv,
snapshotStateDirEnv,
withStateDirEnv,
} from "./state-dir-env.js";
type EnvSnapshot = {
openclaw?: string;
};
function snapshotCurrentStateDirVars(): EnvSnapshot { return {
openclaw: process.env.OPENCLAW_STATE_DIR,
};
}
function expectStateDirVars(snapshot: EnvSnapshot) {
expect(process.env.OPENCLAW_STATE_DIR).toBe(snapshot.openclaw);
}
async function expectPathMissing(filePath: string) {
await expect(fs.stat(filePath)).rejects.toThrow();
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.