mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-14 19:32:15 +01:00
huge refactoring
This commit is contained in:
6
test/internalpkg/xerrortest/doc.go
Normal file
6
test/internalpkg/xerrortest/doc.go
Normal file
@@ -0,0 +1,6 @@
|
||||
/*
|
||||
Package xerrortest contains useful
|
||||
functions for tests related
|
||||
to xerror package.
|
||||
*/
|
||||
package xerrortest
|
||||
18
test/internalpkg/xerrortest/xerrortest.go
Normal file
18
test/internalpkg/xerrortest/xerrortest.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package xerrortest
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/thecodingmachine/gotenberg/internal/pkg/xerror"
|
||||
)
|
||||
|
||||
// AssertError validates that given error
|
||||
// is of an instance of xerror.Error.
|
||||
// If so, returns the instance of xerror.Error.
|
||||
func AssertError(t *testing.T, err error) *xerror.Error {
|
||||
assert.NotNil(t, err)
|
||||
standardized, ok := err.(*xerror.Error)
|
||||
assert.Equal(t, true, ok)
|
||||
return standardized
|
||||
}
|
||||
Reference in New Issue
Block a user