mirror of
https://github.com/goreleaser/goreleaser.git
synced 2025-04-15 11:56:56 +02:00
* fix: improve output a bit Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: improve output a bit Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: revert unwanted changes Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: skip err Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: tests Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * fix: test Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> * chore: build Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
28 lines
656 B
Go
28 lines
656 B
Go
package middleware
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/goreleaser/goreleaser/internal/pipe"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestError(t *testing.T) {
|
|
t.Run("no errors", func(t *testing.T) {
|
|
require.NoError(t, ErrHandler(mockAction(nil))(ctx))
|
|
})
|
|
|
|
t.Run("pipe skipped", func(t *testing.T) {
|
|
require.NoError(t, ErrHandler(mockAction(pipe.ErrSkipValidateEnabled))(ctx))
|
|
})
|
|
|
|
t.Run("pipe expected skipped", func(t *testing.T) {
|
|
require.NoError(t, ErrHandler(mockAction(pipe.ErrSkipDisabledPipe))(ctx))
|
|
})
|
|
|
|
t.Run("some err", func(t *testing.T) {
|
|
require.Error(t, ErrHandler(mockAction(fmt.Errorf("pipe errored")))(ctx))
|
|
})
|
|
}
|