MCPcopy Create free account
hub / github.com/basecamp/hey-cli / runJournalWrite

Function runJournalWrite

internal/cmd/journal_test.go:64–86  ·  view source on GitHub ↗
(t *testing.T, server *httptest.Server, args ...string)

Source from the content-addressed store, hash-verified

62}
63
64func runJournalWrite(t *testing.T, server *httptest.Server, args ...string) (output.Response, error) {
65 t.Helper()
66 t.Setenv("HEY_TOKEN", "test-token")
67 t.Setenv("HEY_NO_KEYRING", "1")
68 t.Setenv("HEY_BASE_URL", "")
69 tmpDir := t.TempDir()
70 t.Setenv("XDG_CONFIG_HOME", tmpDir)
71 t.Setenv("XDG_STATE_HOME", tmpDir)
72 t.Setenv("XDG_CACHE_HOME", tmpDir)
73
74 root := newRootCmd()
75 var buf bytes.Buffer
76 root.SetOut(&buf)
77 root.SetErr(&buf)
78 root.SetArgs(append([]string{"journal", "write", "--json", "--base-url", server.URL}, args...))
79
80 err := root.Execute()
81 var resp output.Response
82 if buf.Len() > 0 {
83 _ = json.Unmarshal(buf.Bytes(), &resp)
84 }
85 return resp, err
86}
87
88func TestJournalWritePositionalContent(t *testing.T) {
89 server := journalServer(t)

Calls 1

newRootCmdFunction · 0.85

Tested by

no test coverage detected