Skip to content

Commit

Permalink
fix: tests on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
caarlos0 committed Jan 21, 2025
1 parent 4019c51 commit 2c802b8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spinner/spinner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package spinner
import (
"context"
"errors"
"io"
"reflect"
"strings"
"testing"
Expand All @@ -11,6 +12,7 @@ import (
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/muesli/termenv"
)

func TestNewSpinner(t *testing.T) {
Expand Down Expand Up @@ -138,11 +140,15 @@ func TestSpinnerWithActionError(t *testing.T) {
func exercise(t *testing.T, factory func() *Spinner, checker func(tb testing.TB, err error)) {
t.Helper()
t.Run("accessible", func(t *testing.T) {
err := factory().Accessible(true).Run()
s := factory().Accessible(true)
s.output = termenv.NewOutput(io.Discard)
err := s.Run()
checker(t, err)
})
t.Run("regular", func(t *testing.T) {
err := factory().Accessible(false).Run()
s := factory().Accessible(false)
s.output = termenv.NewOutput(io.Discard)
err := s.Run()
checker(t, err)
})
}
Expand Down

0 comments on commit 2c802b8

Please sign in to comment.