github.com/gobuffalo/buffalo-cli/v2@v2.0.0-alpha.15.0.20200919213536-a7350c8e6799/cli/cmds/test/ifaces.go (about)

     1  package test
     2  
     3  import (
     4  	"context"
     5  	"os/exec"
     6  
     7  	"github.com/gobuffalo/plugins"
     8  	"github.com/gobuffalo/plugins/plugio"
     9  )
    10  
    11  // Tester is a sub-command of buffalo test.
    12  // 	buffalo test webpack
    13  type Tester interface {
    14  	plugins.Plugin
    15  	Test(ctx context.Context, root string, args []string) error
    16  }
    17  
    18  type BeforeTester interface {
    19  	plugins.Plugin
    20  	BeforeTest(ctx context.Context, root string, args []string) error
    21  }
    22  
    23  type AfterTester interface {
    24  	plugins.Plugin
    25  	AfterTest(ctx context.Context, root string, args []string, err error) error
    26  }
    27  
    28  type Runner interface {
    29  	plugins.Plugin
    30  	RunTests(ctx context.Context, root string, cmd *exec.Cmd) error
    31  }
    32  
    33  type Argumenter interface {
    34  	plugins.Plugin
    35  	TestArgs(ctx context.Context, root string) ([]string, error)
    36  }
    37  
    38  type Namer interface {
    39  	Tester
    40  	CmdName() string
    41  }
    42  
    43  type Aliaser interface {
    44  	Tester
    45  	CmdAliases() []string
    46  }
    47  type Stdouter = plugio.Outer