Skip to content

Commit

Permalink
use contains instead of regex
Browse files Browse the repository at this point in the history
  • Loading branch information
XUANHE ZHOU committed Jun 30, 2020
1 parent d510f86 commit 8d731b2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions misc/test/examples_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"net/http"
"os"
"path"
"regexp"
"strings"
"testing"
"time"
Expand Down Expand Up @@ -253,7 +252,7 @@ func TestAccAwsPyServerlessRaw(t *testing.T) {
Dir: path.Join(getCwd(t), "..", "..", "aws-py-serverless-raw"),
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
assertHTTPResult(t, stack.Outputs["endpoint"].(string)+"/hello", nil, func(body string) bool {
return assert.Regexp(t, regexp.MustCompile("{\"Path\":\"hello\",\"Count\":[0-9]+}"), body)
return assert.Contains(t, body, "{\"Path\":\"hello\",\"Count\":1}")
})
},
})
Expand Down Expand Up @@ -497,7 +496,7 @@ func TestAccAwsTsServerlessRaw(t *testing.T) {
Dir: path.Join(getCwd(t), "..", "..", "aws-ts-serverless-raw"),
ExtraRuntimeValidation: func(t *testing.T, stack integration.RuntimeValidationStackInfo) {
assertHTTPResult(t, stack.Outputs["endpoint"].(string)+"/hello", nil, func(body string) bool {
return assert.Regexp(t, regexp.MustCompile("{\"Path\":\"hello\",\"Count\":[0-9]+}"), body)
return assert.Contains(t, body, "{\"Path\":\"hello\",\"Count\":1}")
})
},
})
Expand Down

0 comments on commit 8d731b2

Please sign in to comment.