Documentation ¶
Overview ¶
Package testing define helper / mock for unit testing
Because golang likes return error object instead of exception/panic, always handle error return values is a good practise. But sometimes it is impossible to got error, such as read from memory buffer, not handler them maybe maybe loose error because someday code changes, but handle them needs a lot of duplicate codes.
In package testing contains many test helper packages, suffix with `th', to handle these never happen errors. Test helper check the error result, if it is not nil, using testing.Fatal(err) to log the error object and abort current test case execution.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetupTeardown ¶
SetupTeardown add setup/teardown support to nested testing.T.Run() sub tests.
Wrap sub test function, run setup before sub test, defer teardown after sub test.
Both setup and teardown can be nil.
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package matcher contains extended Matchers for gomega
|
Package matcher contains extended Matchers for gomega |
mongo
|
|
reset package manage resettable operations useful for unit testing.
|
reset package manage resettable operations useful for unit testing. |