This commit is contained in:
parent
8954cffb7a
commit
1913d9eaf0
@ -2,7 +2,6 @@ package server
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"net/http/httptest"
|
"net/http/httptest"
|
||||||
"strings"
|
"strings"
|
||||||
@ -18,8 +17,7 @@ func TestRegisterUser(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
database, err := postgres.Connect("pgtx", cfg.DatabaseConnection)
|
database, err := postgres.Connect("pgtx", cfg.DatabaseConnection)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("could not connect to db: %s\n", err)
|
t.Errorf("connect to DB: %v", err)
|
||||||
t.Skip()
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,20 +26,20 @@ var cfg = config.Config{ //nolint:gochecknoglobals
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() { //nolint:gochecknoinits
|
func init() { //nolint:gochecknoinits
|
||||||
|
_, err := postgres.Connect("pgx", cfg.DatabaseConnection)
|
||||||
|
if err != nil {
|
||||||
|
log.Fatalf("failed connecting to DB for migrations: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
txdb.Register("pgtx", "pgx", cfg.DatabaseConnection)
|
txdb.Register("pgtx", "pgx", cfg.DatabaseConnection)
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestMain(t *testing.T) {
|
func TestMain(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
_, err := postgres.Connect("pgx", cfg.DatabaseConnection)
|
|
||||||
if err != nil {
|
|
||||||
log.Fatalf("Failed connecting to DB: %v", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
queries, err := postgres.Connect("pgtx", cfg.DatabaseConnection)
|
queries, err := postgres.Connect("pgtx", cfg.DatabaseConnection)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed connecting to DB: %v", err)
|
t.Errorf("connect to DB: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
static, err := fs.Sub(web.Static, "dist")
|
static, err := fs.Sub(web.Static, "dist")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user