testctx

package
v1.26.1 Latest Latest
Warning

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

Go to latest
Published: May 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package testctx provides a test context to be used in unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GitHubTokenType

func GitHubTokenType(ctx *context.Context)

func GitLabTokenType

func GitLabTokenType(ctx *context.Context)

func GiteaTokenType

func GiteaTokenType(ctx *context.Context)

func New

func New(opts ...Opt) *context.Context

func NewWithCfg

func NewWithCfg(c config.Project, opts ...Opt) *context.Context

func Partial added in v1.23.0

func Partial(ctx *context.Context)

func Snapshot

func Snapshot(ctx *context.Context)

func WithFakeRuntime

func WithFakeRuntime(ctx *context.Context)

Types

type Opt

type Opt func(ctx *context.Context)

Opt is an option for a test context.

func Skip added in v1.21.0

func Skip(keys ...skips.Key) Opt

func WithCommit

func WithCommit(commig string) Opt

func WithCommitDate

func WithCommitDate(d time.Time) Opt

func WithCurrentTag

func WithCurrentTag(tag string) Opt

func WithDate

func WithDate(t time.Time) Opt

func WithEnv

func WithEnv(env map[string]string) Opt

func WithGitInfo

func WithGitInfo(git context.GitInfo) Opt

func WithPreviousTag

func WithPreviousTag(tag string) Opt

func WithSemver

func WithSemver(major, minor, patch uint64, prerelease string) Opt

func WithToken

func WithToken(t string) Opt

func WithTokenType

func WithTokenType(t context.TokenType) Opt

func WithVersion

func WithVersion(v string) Opt

Jump to

Keyboard shortcuts

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