Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitBlogStore ¶
func InitBlogStore(filepath string) (blogstore.StoreInterface, error)
InitBlogStore creates only an in-memory blogstore for testing. Useful for tests that don't need the AI stores.
func InitStores ¶
func InitStores(filepath string) (blogstore.StoreInterface, customstore.StoreInterface, settingstore.StoreInterface, error)
InitStores creates in-memory blogstore, customstore, and settingstore instances for testing. The SQLite driver (modernc.org/sqlite) must be imported with a side-effect import in _test.go files of the consuming package, NOT here. This avoids double driver registration panics when a host project that already imports modernc.org/sqlite also imports this testutils package.
Example (in your _test.go file):
import (
"github.com/dracory/blogadmin/testutils"
_ "modernc.org/sqlite"
)
store, customStore, settingStore, err := testutils.InitStores(":memory:")
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.