macroclaw 0.25.0 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/sessions.test.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it } from "bun:test";
|
|
1
|
+
import { afterEach, beforeEach, describe, expect, it } from "bun:test";
|
|
2
2
|
import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { loadSessions, newSessionId, saveSessions } from "./sessions";
|
|
5
5
|
|
|
6
6
|
const tmpDir = "/tmp/macroclaw-sessions-test";
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function cleanup() {
|
|
9
9
|
if (existsSync(tmpDir)) rmSync(tmpDir, { recursive: true });
|
|
10
|
-
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
beforeEach(cleanup);
|
|
13
|
+
afterEach(cleanup);
|
|
11
14
|
|
|
12
15
|
describe("loadSessions", () => {
|
|
13
16
|
it("returns empty object when dir does not exist", () => {
|
|
@@ -679,6 +679,9 @@ describe("status", () => {
|
|
|
679
679
|
});
|
|
680
680
|
mockExistsSync.mockReturnValue(false);
|
|
681
681
|
const mgr = createManager({ home: "/nonexistent" });
|
|
682
|
+
// Override isInstalled getter — on hosts where macroclaw is installed as a systemd
|
|
683
|
+
// service, existsSync("/etc/systemd/system/macroclaw.service") returns true
|
|
684
|
+
Object.defineProperty(mgr, "isInstalled", { get: () => false });
|
|
682
685
|
const s = mgr.status();
|
|
683
686
|
expect(s.installed).toBe(false);
|
|
684
687
|
expect(s.running).toBe(false);
|