diff --git a/apps/server/internal/db/sqlc/db_test.go b/apps/server/internal/db/sqlc/db_test.go new file mode 100644 index 0000000..939c714 --- /dev/null +++ b/apps/server/internal/db/sqlc/db_test.go @@ -0,0 +1,22 @@ +package db + +import ( + "testing" + + "github.com/jackc/pgx/v5" + "github.com/stretchr/testify/assert" +) + +type mockTx struct { + pgx.Tx +} + +func TestWithTx(t *testing.T) { + q := &Queries{} + tx := &mockTx{} + + qWithTx := q.WithTx(tx) + + assert.NotNil(t, qWithTx) + assert.Equal(t, tx, qWithTx.db) +}