testutil

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed testdata/scripts.js
	GlobalScript string
	//go:embed testdata/task.yaml
	TaskSchema string
	//go:embed testdata/user.yaml
	UserSchema string
	//go:embed testdata/account.yaml
	AccountSchema  string
	AllCollections = []string{AccountSchema, UserSchema, TaskSchema}
)

Functions

func NewTaskDoc

func NewTaskDoc(usrID string) *myjson.Document

func NewUserDoc

func NewUserDoc() *myjson.Document

func Seed added in v0.3.9

func Seed(ctx context.Context, db myjson.Database, accounts int, usersPerAccount int, tasksPerUser int) error

func SeedUsers added in v0.3.3

func SeedUsers(ctx context.Context, db myjson.Database, perAccount int, tasksPerUser int) error

func Test added in v0.3.9

func Test(t *testing.T, cfg TestConfig, fn TestFunc) func(*testing.T)

func TestDB

func TestDB(fn func(ctx context.Context, db myjson.Database), opts ...myjson.DBOpt) error

Types

type TestConfig added in v0.3.9

type TestConfig struct {
	Opts        []myjson.DBOpt
	Persist     bool
	Collections []string
	Values      string
	Roles       []string
	Timeout     time.Duration
}

type TestFunc added in v0.3.9

type TestFunc func(ctx context.Context, t *testing.T, db myjson.Database)

Jump to

Keyboard shortcuts

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