MCPcopy Create free account
hub / github.com/github/gh-aw / TestRunListWorkflows_TextOutput

Function TestRunListWorkflows_TextOutput

pkg/cli/list_workflows_command_test.go:86–108  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

84}
85
86func TestRunListWorkflows_TextOutput(t *testing.T) {
87 // Save current directory
88 originalDir, err := os.Getwd()
89 require.NoError(t, err, "Failed to get current directory")
90
91 // Change to repository root
92 repoRoot := filepath.Join(originalDir, "..", "..")
93 err = os.Chdir(repoRoot)
94 require.NoError(t, err, "Failed to change to repository root")
95 defer os.Chdir(originalDir)
96
97 // Test text output
98 t.Run("Text output without pattern", func(t *testing.T) {
99 err := RunListWorkflows("", ".github/workflows", "", false, false, "")
100 assert.NoError(t, err, "RunListWorkflows without JSON flag should not error")
101 })
102
103 // Test text output with pattern
104 t.Run("Text output with pattern", func(t *testing.T) {
105 err := RunListWorkflows("", ".github/workflows", "ci-", false, false, "")
106 assert.NoError(t, err, "RunListWorkflows with pattern should not error")
107 })
108}
109
110func TestNewListCommand(t *testing.T) {
111 cmd := NewListCommand()

Callers

nothing calls this directly

Calls 2

RunListWorkflowsFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected