Skip to content

Commit

Permalink
Add a test to ensure lowercase method works
Browse files Browse the repository at this point in the history
  • Loading branch information
ankur22 committed Oct 17, 2024
1 parent 4802639 commit aedd78e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions tests/page_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,20 @@ func TestPageOnMetric(t *testing.T) {
});`,
want: "ping-1",
},
{
// With method field " get ", which is to ensure it is internally
// converted to "GET" before comparing.
name: "lowercase_needs_trimming",
fun: `page.on('metric', (metric) => {
metric.tag({
name:'ping-1',
matches: [
{url: /^http:\/\/127\.0\.0\.1\:[0-9]+\/ping\?h=[0-9a-z]+$/, method: ' get '},
]
});
});`,
want: "ping-1",
},
{
// When supplying the wrong request method (POST) when it should be GET.
// In this case the URLs aren't grouped.
Expand Down

0 comments on commit aedd78e

Please sign in to comment.