Skip to content

Commit ec7d401

Browse files
committed
Updated output style
1 parent f7f835d commit ec7d401

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

bubble-tea-executor.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ func (b bubbleTeaExecutor) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
105105
progress: -1,
106106
duration: -1,
107107

108-
progressBar: progress.New(progress.WithDefaultGradient()),
108+
progressBar: progress.New(progress.WithGradient("#17B978", "#A7FF83")),
109109
spinner: spinner.New(),
110110
}
111111
tc.spinner.Spinner = spinner.MiniDot
@@ -158,21 +158,22 @@ func (b bubbleTeaExecutor) View() string {
158158
}
159159

160160
for i, tc := range b.testsContext {
161-
data.WriteString(fmt.Sprintf("[%d/%d] %s\n", i+1, b.testCount, tc.name))
161+
data.WriteString(fmt.Sprintf(" [%d/%d] %s ", i+1, b.testCount, tc.name))
162+
if tc.duration > 0 {
163+
data.WriteString(fmt.Sprintf("finished in %s\n", tc.duration))
164+
} else {
165+
data.WriteString("running...\n")
166+
}
162167

163168
if tc.progress >= 0 {
164169
tc.progressBar.Width = b.w - 4
165170
if tc.progress == 1 {
166-
data.WriteString(" ")
171+
data.WriteString(" ")
167172
} else {
168173
data.WriteString(fmt.Sprintf(" %s ", tc.spinner.View()))
169174
}
170175

171-
data.WriteString(tc.progressBar.View() + "\n")
172-
}
173-
174-
if tc.duration > 0 {
175-
data.WriteString(fmt.Sprintf("Finished in %s\n\n", tc.duration))
176+
data.WriteString(tc.progressBar.View() + "\n\n")
176177
}
177178
}
178179

0 commit comments

Comments
 (0)