(t *testing.T, cmd *cobra.Command, args ...string)
| 46 | } |
| 47 | |
| 48 | func 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 | |
| 60 | func execute(cmd *cobra.Command, args ...string) (*bytes.Buffer, error) { |
| 61 | b := new(bytes.Buffer) |
no test coverage detected