MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / openTestDB

Function openTestDB

integrations/gorm/plugin_test.go:24–34  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

22}
23
24func openTestDB(t *testing.T) *gorm.DB {
25 t.Helper()
26 db, err := gorm.Open(sqlite.Open(":memory:"), &gorm.Config{
27 Logger: logger.Default.LogMode(logger.Silent),
28 })
29 if err != nil {
30 t.Fatalf("open gorm db: %v", err)
31 }
32 _ = db.AutoMigrate(&User{}, &Order{})
33 return db
34}
35
36func TestPlugin_Name(t *testing.T) {
37 plugin := gosqlxgorm.NewPlugin()

Calls 3

OpenMethod · 0.80
HelperMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected