(t *testing.T)
| 10 | ) |
| 11 | |
| 12 | func TestLambdaCronStack(t *testing.T) { |
| 13 | // GIVEN |
| 14 | app := awscdk.NewApp(nil) |
| 15 | |
| 16 | // WHEN |
| 17 | stack := NewLambdaCronStack(app, "MyStack", nil) |
| 18 | |
| 19 | // THEN |
| 20 | bytes, err := json.Marshal(app.Synth(nil).GetStackArtifact(stack.ArtifactId()).Template()) |
| 21 | if err != nil { |
| 22 | t.Error(err) |
| 23 | } |
| 24 | |
| 25 | template := gjson.ParseBytes(bytes) |
| 26 | handler := template.Get("Resources.Singleton8C7B99F3.Properties.Handler").String() |
| 27 | assert.Equal(t, "handler.main", handler) |
| 28 | } |
nothing calls this directly
no test coverage detected