feat: 0.0.1
This commit is contained in:
146 files changed
+10444
No files matched your search
@@ -0,0 +1,30 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/FernandoJVideira/simple_bank/internal/config"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
_ "github.com/jackc/pgx/v5/stdlib"
|
||||
)
|
||||
|
||||
var testStore Store
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
config, err := config.LoadTestConfig("../../..")
|
||||
if err != nil {
|
||||
log.Fatal("cannot load config:", err)
|
||||
}
|
||||
|
||||
connPool, err := pgxpool.New(context.Background(), config.DBAddr)
|
||||
if err != nil {
|
||||
log.Fatal("cannot connect to db:", err)
|
||||
}
|
||||
|
||||
testStore = NewPostgresStore(connPool)
|
||||
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
Reference in new issue
Block a user