(t *testing.T)
| 84 | } |
| 85 | |
| 86 | func 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 | |
| 110 | func TestNewListCommand(t *testing.T) { |
| 111 | cmd := NewListCommand() |
nothing calls this directly
no test coverage detected