fix: expand reply cwd (~) and document AGENTS
This commit is contained in:
@@ -9,6 +9,7 @@ import {
|
||||
jidToE164,
|
||||
normalizeE164,
|
||||
normalizePath,
|
||||
resolveUserPath,
|
||||
sleep,
|
||||
toWhatsappJid,
|
||||
withWhatsAppPrefix,
|
||||
@@ -85,3 +86,19 @@ describe("jidToE164", () => {
|
||||
spy.mockRestore();
|
||||
});
|
||||
});
|
||||
|
||||
describe("resolveUserPath", () => {
|
||||
it("expands ~ to home dir", () => {
|
||||
expect(resolveUserPath("~")).toBe(path.resolve(os.homedir()));
|
||||
});
|
||||
|
||||
it("expands ~/ to home dir", () => {
|
||||
expect(resolveUserPath("~/clawd")).toBe(
|
||||
path.resolve(os.homedir(), "clawd"),
|
||||
);
|
||||
});
|
||||
|
||||
it("resolves relative paths", () => {
|
||||
expect(resolveUserPath("tmp/dir")).toBe(path.resolve("tmp/dir"));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user