testutils

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL