config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Failed = func(s string) string {
	return FailedSigil + s
}

Formatter for failed Match

View Source
var FailedSigil = "✘ "

Sigil for failed Match.

default: "✘ "

View Source
var FailedSuppressed = func(s string) string {
	sig := FailedSuppressedSigil
	return sig + s
}

Formatter for failed Match in passed test

View Source
var FailedSuppressedSigil = "~ "

Sigil for failed but suppressed Match

default: "* "

View Source
var FilepathReplace = []replacer{}

When set, this filepath will be replaced with FilepathReplaceWith value. If this value is empty string, replacing is not performed.

Default is value of envvar ITS_REPLACE_FILEPATH. When you set a special value "!project" to ITS_REPLACE_FILEPATH, the replace path will be the project root detected by heuristics.

The project root is the most shallow filepath having ".git", "go.work" or "go.mod" from working directory.

View Source
var INDENT = "    "

Indent of messages

View Source
var Pass = func(s string) string {
	return PassSigil + s
}

Formatter for passed Match

View Source
var PassSigil = "✔ "

Sigil for passed Match

default; "✔ "

View Source
var StrictModeForStruct = false

If false (lax mode), by default, nil matchers in spec generated its-structer will fallback to its.Always().

If set true (strict mode), nil matchers fallback to its.Never()

Functions

func ReplaceFilepath added in v0.4.0

func ReplaceFilepath(p string) string

func ReplaceProjectRoot added in v0.2.0

func ReplaceProjectRoot()

Work as start test with envvar ITS_REPLACE_FILEPATH=!project .

func StrictStructMatch added in v0.1.3

func StrictStructMatch(t interface{ Cleanup(func()) }, strict bool)

When setting strict mode, nil fields in struct spec, generated by structer, fallback to its.Never() during test t.

The configuration will be rolled back at the end of the test.

Types

This section is empty.

Jump to

Keyboard shortcuts

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