MCPcopy Create free account
hub / github.com/anchordotdev/cli / TestHelp

Function TestHelp

cmdtest/cmdtest.go:48–58  ·  view source on GitHub ↗
(t *testing.T, cmd *cobra.Command, args ...string)

Source from the content-addressed store, hash-verified

46}
47
48func TestHelp(t *testing.T, cmd *cobra.Command, args ...string) {
49 root := cmd.Root()
50
51 b, err := execute(root, args...)
52 require.NoError(t, err)
53
54 out, err := io.ReadAll(b)
55 require.NoError(t, err)
56
57 uitest.TestGolden(t, string(out))
58}
59
60func execute(cmd *cobra.Command, args ...string) (*bytes.Buffer, error) {
61 b := new(bytes.Buffer)

Callers 15

TestCmdRootFunction · 0.92
TestCmdTrustFunction · 0.92
TestCmdTrustAuditFunction · 0.92
TestCmdTrustCleanFunction · 0.92
TestCmdAuthFunction · 0.92
TestCmdAuthWhoAmIFunction · 0.92
TestCmdAuthSignoutFunction · 0.92
TestCmdAuthSigninFunction · 0.92
TestCmdLclMkCertFunction · 0.92
TestCmdLclTrustFunction · 0.92
TestCmdLclSetupFunction · 0.92
TestCmdBootstrapFunction · 0.92

Calls 3

TestGoldenFunction · 0.92
executeFunction · 0.85
ReadAllMethod · 0.65

Tested by

no test coverage detected