mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-10 14:24:59 +00:00
fix(test): tolerate runtime exit in cli smoke
This commit is contained in:
@@ -28,31 +28,35 @@ describe("cli program (smoke)", () => {
|
|||||||
|
|
||||||
it("runs message with required options", async () => {
|
it("runs message with required options", async () => {
|
||||||
const program = buildProgram();
|
const program = buildProgram();
|
||||||
await program.parseAsync(["message", "send", "--target", "+1", "--message", "hi"], {
|
await expect(
|
||||||
from: "user",
|
program.parseAsync(["message", "send", "--target", "+1", "--message", "hi"], {
|
||||||
});
|
from: "user",
|
||||||
|
}),
|
||||||
|
).rejects.toThrow("exit");
|
||||||
expect(messageCommand).toHaveBeenCalled();
|
expect(messageCommand).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("runs message react with signal author fields", async () => {
|
it("runs message react with signal author fields", async () => {
|
||||||
const program = buildProgram();
|
const program = buildProgram();
|
||||||
await program.parseAsync(
|
await expect(
|
||||||
[
|
program.parseAsync(
|
||||||
"message",
|
[
|
||||||
"react",
|
"message",
|
||||||
"--channel",
|
"react",
|
||||||
"signal",
|
"--channel",
|
||||||
"--target",
|
"signal",
|
||||||
"signal:group:abc123",
|
"--target",
|
||||||
"--message-id",
|
"signal:group:abc123",
|
||||||
"1737630212345",
|
"--message-id",
|
||||||
"--emoji",
|
"1737630212345",
|
||||||
"✅",
|
"--emoji",
|
||||||
"--target-author-uuid",
|
"✅",
|
||||||
"123e4567-e89b-12d3-a456-426614174000",
|
"--target-author-uuid",
|
||||||
],
|
"123e4567-e89b-12d3-a456-426614174000",
|
||||||
{ from: "user" },
|
],
|
||||||
);
|
{ from: "user" },
|
||||||
|
),
|
||||||
|
).rejects.toThrow("exit");
|
||||||
expect(messageCommand).toHaveBeenCalled();
|
expect(messageCommand).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user