MCPcopy Create free account
hub / github.com/diillson/chatcli / TestRunChatGraphView

Function TestRunChatGraphView

cli/chat_graphview_test.go:72–84  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

70}
71
72func TestRunChatGraphView(t *testing.T) {
73 dir := t.TempDir()
74 out := filepath.Join(dir, "g.html")
75 cli := &ChatCLI{}
76 args := `{"output":"` + out + `","open":false,"nodes":[{"id":"a","label":"A"}],"edges":[]}`
77 res := cli.runChatGraphView(context.Background(), args)
78 if strings.HasPrefix(res, "graphview error") {
79 t.Fatalf("unexpected error: %s", res)
80 }
81 if _, err := os.Stat(out); err != nil {
82 t.Fatalf("output not written: %v", err)
83 }
84}
85
86func TestConfigChatGraphViewToggle(t *testing.T) {
87 t.Setenv(chatGraphViewEnvVar, "true")

Callers

nothing calls this directly

Calls 1

runChatGraphViewMethod · 0.95

Tested by

no test coverage detected