(t *testing.T)
| 15 | ) |
| 16 | |
| 17 | func TestStartHandlerFunc(t *testing.T) { |
| 18 | actual := "unexpected" |
| 19 | logFatalf = func(format string, v ...interface{}) { |
| 20 | actual = fmt.Sprintf(format, v...) |
| 21 | } |
| 22 | |
| 23 | f := func(context.Context, any) (any, error) { return 1, nil } |
| 24 | StartHandlerFunc(f) |
| 25 | |
| 26 | assert.Equal(t, "expected AWS Lambda environment variables [_LAMBDA_SERVER_PORT AWS_LAMBDA_RUNTIME_API] are not defined", actual) |
| 27 | |
| 28 | handlerType := reflect.TypeOf(f) |
| 29 | |
| 30 | handlerTakesContext, err := handlerTakesContext(handlerType) |
| 31 | assert.NoError(t, err) |
| 32 | assert.True(t, handlerTakesContext) |
| 33 | |
| 34 | err = validateReturns(handlerType) |
| 35 | assert.NoError(t, err) |
| 36 | } |
nothing calls this directly
no test coverage detected
searching dependent graphs…