Skip to content

Commit

Permalink
FIX
Browse files Browse the repository at this point in the history
  • Loading branch information
evg4b committed Nov 30, 2024
1 parent 19e285e commit b3e7454
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions internal/config/mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestMappings(t *testing.T) {
{From: hosts.Localhost.HTTP(), To: hosts.Github.HTTPS()},
},
expected: []string{
fmt.Sprintf("%s => %s", hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
},
},
{
Expand All @@ -33,8 +33,8 @@ func TestMappings(t *testing.T) {
{From: hosts.Localhost.HTTPS(), To: hosts.Github.HTTPS()},
},
expected: []string{
fmt.Sprintf("%s => %s", hosts.Localhost.HTTPS(), hosts.Github.HTTPS()),
fmt.Sprintf("%s => %s", hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTPS(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
},
},
{
Expand All @@ -57,7 +57,7 @@ func TestMappings(t *testing.T) {
},
},
expected: []string{
fmt.Sprintf("%s => %s", hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
" static: /static => /tmp",
" static: /static2 => /tmp2",
},
Expand All @@ -75,7 +75,7 @@ func TestMappings(t *testing.T) {
},
},
expected: []string{
fmt.Sprintf("%s => %s", hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
" cache: /static",
" cache: /static2",
},
Expand Down Expand Up @@ -122,8 +122,8 @@ func TestMappings(t *testing.T) {
{From: hosts.Localhost.HTTPS(), To: hosts.Github.HTTPS()},
},
expected: []string{
fmt.Sprintf("%s => %s", hosts.Localhost.HTTPS(), hosts.Github.HTTPS()),
fmt.Sprintf("%s => %s", hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTPS(), hosts.Github.HTTPS()),
mapping(hosts.Localhost.HTTP(), hosts.Github.HTTPS()),
"mock: [POST 200] /endpoint-1",
"mock: [GET 500] /demo",
"mock: [GET 403] /healthcheck",
Expand All @@ -148,3 +148,7 @@ func TestMappings(t *testing.T) {
assert.Equal(t, "", actual)
})
}

func mapping(from string, to string) string {
return fmt.Sprintf("%s => %s", from, to)
}

0 comments on commit b3e7454

Please sign in to comment.