Loading...
mutiro agent dev test

Run the tests under tests/ (describe, it, expect)

Synopsis

Run every tests/**/*.test.ts and *.test.js under the config root.

A test file imports the "mutiro/test" module:

import { describe, it, expect, tool, hook, handler } from "mutiro/test";

describe("desk_mark_sent", () => { it("refuses a second send", () => { const r = tool("desk_mark_sent").run( { key: "acme--po1", to: "buyer@acme.com" }, { tools: { supabase_sql: ({ sql }) => ({ rows: [{ quote_generation: 2, sent_generation: 2 }] }) } }, ); expect(r.validation).toContain("ALREADY SENT"); expect(r.calls.map((c) => c.tool)).toEqual(["supabase_sql"]); }); });

tool(name).run(args, { tools, context }), hook(name).run(input, { tools, call }) and handler(page, action).run(payload, { tools }) run the real code on the runtime's engine with the given mocks and return what it decided: kind, result, validation, failure, handoff, skip, reply, refusal, args, text, parts, calls (tool, args, result, error) and logs.

Mocks are plain functions; a test may import shared ones from a sibling file.

expect supports toBe, toEqual, toMatchObject, toContain, toMatch, toBeTruthy, toBeFalsy, toBeDefined, toBeUndefined, toBeNull, toHaveLength, toBeGreaterThan, toBeLessThan, toThrow and .not.

tests/ is a sibling of .genie, outside the config plane: it never syncs to an agent.

Exit status is 1 when any test fails.

mutiro agent dev test <config-root> [flags]

Usage mutiro agent dev test <config-root> [flags]
Options
Flag Type Description
-h, --help bool help for test
--json bool Print the results as JSON
--only string Run only the tests whose title contains this text
Global Options
Flag Type Description
--config string config file (default is ./.mutiro.yaml in current directory)
--debug bool debug mode
-v, --verbose bool verbose output
Subcommands
See Also
mutiro agent dev