mirror of
https://github.com/simon987/ws_bucket.git
synced 2025-12-15 23:59:06 +00:00
minimum viable (excluding auth)
This commit is contained in:
25
test/main_test.go
Normal file
25
test/main_test.go
Normal file
@@ -0,0 +1,25 @@
|
||||
package test
|
||||
|
||||
import (
|
||||
"github.com/jinzhu/gorm"
|
||||
_ "github.com/jinzhu/gorm/dialects/sqlite"
|
||||
"github.com/simon987/ws_bucket/api"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
|
||||
//db, err := gorm.Open("postgres", "host=localhost user=ws_bucket dbname=ws_bucket password=ws_bucket sslmode=disable")
|
||||
db, err := gorm.Open("sqlite3", ":memory:")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
a := api.New(db)
|
||||
go a.Run()
|
||||
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
|
||||
m.Run()
|
||||
}
|
||||
Reference in New Issue
Block a user