1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-01-10 03:47:03 +02:00
goreleaser/internal/testlib/tmpl.go
Carlos Alexandro Becker c91c4b7cd8
feat: improve template error handling (#4256)
- wrap the multiple errors in an internal error with cleaner messaging
- improve testlib.RequireTemplateError and several tests
2023-08-24 22:06:12 -03:00

17 lines
353 B
Go

package testlib
import (
"testing"
"github.com/goreleaser/goreleaser/internal/tmpl"
"github.com/stretchr/testify/require"
)
// RequireTemplateError requires thqt an error happens and that it is a template error.
func RequireTemplateError(tb testing.TB, err error) {
tb.Helper()
require.Error(tb, err)
require.ErrorAs(tb, err, &tmpl.Error{})
}