Documentation ¶
Index ¶
- Constants
- type LambdaAPI
- type ResponseExpectations
- type TestCase
- func (tc *TestCase) Action() string
- func (tc *TestCase) AsDryRun() *TestCase
- func (tc *TestCase) Describe(description string) *TestCase
- func (tc *TestCase) Description() string
- func (tc *TestCase) Execute(t *testing.T) (mt.TestResult, error)
- func (tc *TestCase) ExpectExactPayload(payload interface{}) *TestCase
- func (tc *TestCase) ExpectFunctionError(err string) *TestCase
- func (tc *TestCase) ExpectPayload(payload interface{}) *TestCase
- func (tc *TestCase) ExpectStatus(status int) *TestCase
- func (tc *TestCase) ExpectVersion(version string) *TestCase
- func (tc *TestCase) Target() string
- func (tc *TestCase) WithExecutionLogs() *TestCase
- func (tc *TestCase) WithPayload(payload interface{}) *TestCase
- type TestContext
- type TestResult
Constants ¶
View Source
const (
VersionLatest = "$LATEST"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LambdaAPI ¶
type LambdaAPI interface {
Invoke(input *lambdasvc.InvokeInput) (*lambdasvc.InvokeOutput, error)
}
type ResponseExpectations ¶
type TestCase ¶
type TestCase struct { Desc string FunctionID string HandlerFn interface{} Payload interface{} Expectations ResponseExpectations // contains filtered or unexported fields }
func (*TestCase) Description ¶
func (*TestCase) ExpectExactPayload ¶
func (*TestCase) ExpectFunctionError ¶
func (*TestCase) ExpectPayload ¶
func (*TestCase) ExpectStatus ¶
func (*TestCase) ExpectVersion ¶
func (*TestCase) WithExecutionLogs ¶
func (*TestCase) WithPayload ¶
type TestContext ¶
type TestContext struct {
// contains filtered or unexported fields
}
func DefaultContext ¶
func DefaultContext() *TestContext
DefaultContext returns a LambdaTestContext using a default AWS Lambda service.
func EmptyContext ¶
func EmptyContext() *TestContext
EmptyContext returns a LambdaTestContext with no configured AWS service. It is suitable only for testing local function handlers.
func NewTestContext ¶
func NewTestContext(svc LambdaAPI) *TestContext
NewLambdaFunctionContext creates a new HTTPTestContext for creating tests that target AWS Lambda functions using the provided AWS service.
func (*TestContext) Handle ¶
func (c *TestContext) Handle(handlerFn interface{}, description ...string) *TestCase
type TestResult ¶
type TestResult struct { FunctionError string InvocationError error LogBase64 string Payload []byte Status int Version string // contains filtered or unexported fields }
func (*TestResult) Errors ¶
func (r *TestResult) Errors() []error
func (*TestResult) Log ¶
func (r *TestResult) Log() (string, error)
func (*TestResult) TestCase ¶
func (r *TestResult) TestCase() mt.TestCase
Click to show internal directories.
Click to hide internal directories.