Merged in feature/functestcov (pull request #84)
Function Test Coverage * test * scripts
This commit is contained in:
@@ -8,13 +8,12 @@ import (
|
||||
"github.com/jackc/pgx/v5"
|
||||
"github.com/pashagolub/pgxmock/v3"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestQueriesNew(t *testing.T) {
|
||||
pool, err := pgxmock.NewPool()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to open pgxmock database: %v", err)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
queries := repository.New(pool)
|
||||
assert.NotNil(t, queries)
|
||||
@@ -24,9 +23,7 @@ func TestQueriesWithTx(t *testing.T) {
|
||||
ctx := context.Background()
|
||||
|
||||
pool, err := pgxmock.NewPool()
|
||||
if err != nil {
|
||||
t.Fatalf("failed to open pgxmock database: %v", err)
|
||||
}
|
||||
require.NoError(t, err)
|
||||
|
||||
queries := repository.New(pool)
|
||||
assert.NotNil(t, queries)
|
||||
|
||||
Reference in New Issue
Block a user