mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-12 17:51:22 +00:00
Merged via squash.
Prepared head SHA: 769e90c6af
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
32 lines
977 B
TypeScript
32 lines
977 B
TypeScript
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
import {
|
|
listImportedBundledPluginFacadeIds,
|
|
resetFacadeRuntimeStateForTest,
|
|
} from "../../../src/plugin-sdk/facade-runtime.js";
|
|
import { createIMessageTestPlugin } from "./imessage.test-plugin.js";
|
|
|
|
beforeEach(() => {
|
|
resetFacadeRuntimeStateForTest();
|
|
});
|
|
|
|
afterEach(() => {
|
|
resetFacadeRuntimeStateForTest();
|
|
});
|
|
|
|
describe("createIMessageTestPlugin", () => {
|
|
it("does not load the bundled iMessage facade by default", () => {
|
|
expect(listImportedBundledPluginFacadeIds()).toEqual([]);
|
|
|
|
createIMessageTestPlugin();
|
|
|
|
expect(listImportedBundledPluginFacadeIds()).toEqual([]);
|
|
});
|
|
|
|
it("normalizes repeated transport prefixes without recursive stack growth", () => {
|
|
const plugin = createIMessageTestPlugin();
|
|
const prefixedHandle = `${"imessage:".repeat(5000)}+44 20 7946 0958`;
|
|
|
|
expect(plugin.messaging?.normalizeTarget?.(prefixedHandle)).toBe("+442079460958");
|
|
});
|
|
});
|