mirror of https://github.com/openclaw/openclaw.git
test(auto-reply): type set/unset action helper expectations
This commit is contained in:
parent
28d49b8d44
commit
00e32cf04a
|
|
@ -1,6 +1,11 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import { parseSetUnsetCommand, parseSetUnsetCommandAction } from "./commands-setunset.js";
|
||||
|
||||
type ParsedSetUnsetAction =
|
||||
| { action: "set"; path: string; value: unknown }
|
||||
| { action: "unset"; path: string }
|
||||
| { action: "error"; message: string };
|
||||
|
||||
describe("parseSetUnsetCommand", () => {
|
||||
it("parses unset values", () => {
|
||||
expect(
|
||||
|
|
@ -25,7 +30,7 @@ describe("parseSetUnsetCommand", () => {
|
|||
|
||||
describe("parseSetUnsetCommandAction", () => {
|
||||
it("returns null for non set/unset actions", () => {
|
||||
const result = parseSetUnsetCommandAction({
|
||||
const result = parseSetUnsetCommandAction<ParsedSetUnsetAction>({
|
||||
slash: "/config",
|
||||
action: "show",
|
||||
args: "",
|
||||
|
|
@ -37,7 +42,7 @@ describe("parseSetUnsetCommandAction", () => {
|
|||
});
|
||||
|
||||
it("maps parse errors through onError", () => {
|
||||
const result = parseSetUnsetCommandAction({
|
||||
const result = parseSetUnsetCommandAction<ParsedSetUnsetAction>({
|
||||
slash: "/config",
|
||||
action: "set",
|
||||
args: "",
|
||||
|
|
|
|||
Loading…
Reference in New Issue