mirror of
https://github.com/farcasclaudiu/openclaw.git
synced 2026-06-28 17:01:53 +03:00
refactor: rename clawdbot to moltbot with legacy compat
This commit is contained in:
+5
-5
@@ -38,7 +38,7 @@ describe("withWhatsAppPrefix", () => {
|
||||
|
||||
describe("ensureDir", () => {
|
||||
it("creates nested directory", async () => {
|
||||
const tmp = await fs.promises.mkdtemp(path.join(os.tmpdir(), "clawdbot-test-"));
|
||||
const tmp = await fs.promises.mkdtemp(path.join(os.tmpdir(), "moltbot-test-"));
|
||||
const target = path.join(tmp, "nested", "dir");
|
||||
await ensureDir(target);
|
||||
expect(fs.existsSync(target)).toBe(true);
|
||||
@@ -90,7 +90,7 @@ describe("jidToE164", () => {
|
||||
});
|
||||
|
||||
it("maps @lid from authDir mapping files", () => {
|
||||
const authDir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-auth-"));
|
||||
const authDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-auth-"));
|
||||
const mappingPath = path.join(authDir, "lid-mapping-456_reverse.json");
|
||||
fs.writeFileSync(mappingPath, JSON.stringify("5559876"));
|
||||
expect(jidToE164("456@lid", { authDir })).toBe("+5559876");
|
||||
@@ -98,7 +98,7 @@ describe("jidToE164", () => {
|
||||
});
|
||||
|
||||
it("maps @hosted.lid from authDir mapping files", () => {
|
||||
const authDir = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-auth-"));
|
||||
const authDir = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-auth-"));
|
||||
const mappingPath = path.join(authDir, "lid-mapping-789_reverse.json");
|
||||
fs.writeFileSync(mappingPath, JSON.stringify(4440001));
|
||||
expect(jidToE164("789@hosted.lid", { authDir })).toBe("+4440001");
|
||||
@@ -110,8 +110,8 @@ describe("jidToE164", () => {
|
||||
});
|
||||
|
||||
it("falls back through lidMappingDirs in order", () => {
|
||||
const first = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-lid-a-"));
|
||||
const second = fs.mkdtempSync(path.join(os.tmpdir(), "clawdbot-lid-b-"));
|
||||
const first = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-lid-a-"));
|
||||
const second = fs.mkdtempSync(path.join(os.tmpdir(), "moltbot-lid-b-"));
|
||||
const mappingPath = path.join(second, "lid-mapping-321_reverse.json");
|
||||
fs.writeFileSync(mappingPath, JSON.stringify("123321"));
|
||||
expect(jidToE164("321@lid", { lidMappingDirs: [first, second] })).toBe("+123321");
|
||||
|
||||
Reference in New Issue
Block a user