mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-03 03:03:24 -04: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 () => {
|
||||
const program = buildProgram();
|
||||
await program.parseAsync(["message", "send", "--target", "+1", "--message", "hi"], {
|
||||
from: "user",
|
||||
});
|
||||
await expect(
|
||||
program.parseAsync(["message", "send", "--target", "+1", "--message", "hi"], {
|
||||
from: "user",
|
||||
}),
|
||||
).rejects.toThrow("exit");
|
||||
expect(messageCommand).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("runs message react with signal author fields", async () => {
|
||||
const program = buildProgram();
|
||||
await program.parseAsync(
|
||||
[
|
||||
"message",
|
||||
"react",
|
||||
"--channel",
|
||||
"signal",
|
||||
"--target",
|
||||
"signal:group:abc123",
|
||||
"--message-id",
|
||||
"1737630212345",
|
||||
"--emoji",
|
||||
"✅",
|
||||
"--target-author-uuid",
|
||||
"123e4567-e89b-12d3-a456-426614174000",
|
||||
],
|
||||
{ from: "user" },
|
||||
);
|
||||
await expect(
|
||||
program.parseAsync(
|
||||
[
|
||||
"message",
|
||||
"react",
|
||||
"--channel",
|
||||
"signal",
|
||||
"--target",
|
||||
"signal:group:abc123",
|
||||
"--message-id",
|
||||
"1737630212345",
|
||||
"--emoji",
|
||||
"✅",
|
||||
"--target-author-uuid",
|
||||
"123e4567-e89b-12d3-a456-426614174000",
|
||||
],
|
||||
{ from: "user" },
|
||||
),
|
||||
).rejects.toThrow("exit");
|
||||
expect(messageCommand).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user