fixes waitTimeout, waitDelay not working with float

This commit is contained in:
Julien Neuhart
2019-07-08 17:24:17 +02:00
parent 186c09f29b
commit 9af00d6d58
11 changed files with 110 additions and 18 deletions

View File

@@ -16,6 +16,7 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/thecodingmachine/gotenberg/internal/pkg/standarderror"
"golang.org/x/sync/errgroup"
)
@@ -39,6 +40,15 @@ func AssertConcurrent(t *testing.T, fn func() error, amount int) {
assert.NoError(t, err)
}
// RequireStandardError validates that given error
// is of an instance of standarderror.Error.
// If so, returns the instance of standarderror.Error.
func RequireStandardError(t *testing.T, err error) *standarderror.Error {
standardized, ok := err.(*standarderror.Error)
require.Equal(t, ok, true)
return standardized
}
// HTMLTestMultipartForm returns the body
// for a multipate/form-data request with all
// files under "html" folder.