Skip to content

Commit

Permalink
Added tests for formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
evg4b committed Jan 4, 2024
1 parent fe3f161 commit cc683a7
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions internal/config/mappings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,49 @@ func TestMappings(t *testing.T) {
"http://localhost => https://github.com",
},
},
{
name: "http and https mappings with statics",
mappings: config.Mappings{
{
From: hosts.Localhost.HTTP(),
To: hosts.Github.HTTPS(),
Statics: config.StaticDirectories{
{
Path: "/static",
Dir: "/tmp",
},
{
Path: "/static2",
Dir: "/tmp2",
Index: "index.html",
},
},
},
},
expected: []string{
"http://localhost => https://github.com",
" static: /static => /tmp",
" static: /static2 => /tmp2",
},
},
{
name: "http and https mappings with cache",
mappings: config.Mappings{
{
From: hosts.Localhost.HTTP(),
To: hosts.Github.HTTPS(),
Cache: config.CacheGlobs{
"/static",
"/static2",
},
},
},
expected: []string{
"http://localhost => https://github.com",
" cache: /static",
" cache: /static2",
},
},
{
name: "mapping and mocks",
mappings: config.Mappings{
Expand Down

0 comments on commit cc683a7

Please sign in to comment.