test

package
v0.12.0-beta.4 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

test package contains the tooling for the test command on the cli. The goal of this package is to provide the structure for test commands to run and be organized.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AfterTester

type AfterTester interface {
	core.Plugin
	RunAfterTest(context.Context, string, []string) error
}

AfterTester is suited for things that need to run after the tests cleanup and organization things, maybe reporting or collecting metrics.

type BeforeTester

type BeforeTester interface {
	core.Plugin

	RunBeforeTest(context.Context, string, []string) error
}

BeforeTester interface is suited for those tasks that need to happen before the tests run, things like setting up environment variables, clearing the database or other cleanup tasks.

type Command

type Command struct {
	// contains filtered or unexported fields
}

func (Command) Alias

func (c Command) Alias() string

func (Command) HelpText

func (c Command) HelpText() string

func (Command) Name

func (c Command) Name() string

func (Command) ParentName

func (c Command) ParentName() string

func (*Command) Receive

func (b *Command) Receive(plugins []core.Plugin)

Receive takes BeforeTesters, AfterTesters and Testers from the passed list of pugins and save those in the instance of Command so these get used later on.

func (*Command) Run

func (c *Command) Run(ctx context.Context, root string, args []string) error

type Tester

type Tester interface {
	Test(context.Context, string, []string) error
}

Tester runs a set of tests depending on the tools you want to test, this could include - Go test (go test ...) - Linting (gofmt/metalinter/milo) - Yarn/NPM tests

Jump to

Keyboard shortcuts

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