Skip to content

Commit 1e141c7

Browse files
Added tests
1 parent f949bf3 commit 1e141c7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

demux/config_test.go

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package demux
2+
3+
import (
4+
"context"
5+
"github.com/aws/aws-lambda-go/events"
6+
"github.com/stretchr/testify/assert"
7+
"testing"
8+
)
9+
10+
func TestConfigWorks(t *testing.T) {
11+
externalCfg := &Cfg{
12+
Factories: []Factory{
13+
func(ctx *EventContext) any {
14+
return nil
15+
},
16+
},
17+
Handlers: []any{
18+
func(ctx context.Context, event *events.APIGatewayProxyRequest) (
19+
*events.APIGatewayProxyResponse,
20+
error) {
21+
return nil, nil
22+
},
23+
},
24+
}
25+
26+
cfg, err := newDemuxCfg(externalCfg)
27+
assert.NoError(t, err)
28+
assert.NotNil(t, cfg)
29+
}

0 commit comments

Comments
 (0)