Documentation ¶
Index ¶
- Variables
- func Once(fn interface{}) interface{}
- type T
- type Tedi
- func (t *Tedi) AfterTest(fn interface{})
- func (t *Tedi) BeforeTest(fn interface{})
- func (t *Tedi) Fixture(fn interface{}) error
- func (t *Tedi) OnceFixture(fn interface{}) error
- func (t *Tedi) Run() int
- func (t *Tedi) Test(name string, fn interface{}, labels ...string)
- func (t *Tedi) TestLabel(name string)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrFixtureMustBeFunction thrown if a fixture is not a function ErrFixtureMustBeFunction = errors.New("fixture can only be functions") // ErrFixtureCannotProduceTestingTB thrown if a fixture produces a testing.TB ErrFixtureCannotProduceTestingTB = errors.New("fixture cannot produce testing.TB") )
Functions ¶
Types ¶
type T ¶
T extends testing.T struct with hooks to be called before and after the test has been executed and a Run method that also works with dependency injection.
func (*T) AfterTest ¶
func (t *T) AfterTest(fn interface{})
AfterTest register a function to be called once the test was executed.
func (*T) BeforeTest ¶
func (t *T) BeforeTest(fn interface{})
BeforeTest register a function to be called before a test will run.
type Tedi ¶
type Tedi struct {
// contains filtered or unexported fields
}
Tedi encapsulates tests for an entire package.
func (*Tedi) AfterTest ¶
func (t *Tedi) AfterTest(fn interface{})
AfterTest registers a function as a afterTest hook.
func (*Tedi) BeforeTest ¶
func (t *Tedi) BeforeTest(fn interface{})
BeforeTest registers a function as a beforeTest hook.
func (*Tedi) OnceFixture ¶
OnceFixture registers a function as a fixture that should only be called once.
Click to show internal directories.
Click to hide internal directories.