Skip to content

Commit

Permalink
fix(plugin): just use redirect status code for now
Browse files Browse the repository at this point in the history
  • Loading branch information
blurrah committed Aug 30, 2023
1 parent 1d155b5 commit 20d0db2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions internal/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (p *VercelPlugin) RenderTerraformComponent(site string, component string) (
vercel_project_domains = [{{range .ProjectConfig.ProjectDomains }}
{
{{ renderProperty "domain" .Domain }}
{{ renderProperty "redirect_status_code" .RedirectStatusCode }}
},{{end}}
]
`
Expand Down
4 changes: 1 addition & 3 deletions internal/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestSetVercelConfig(t *testing.T) {
}

projectDomains := []ProjectDomain{
{Domain: "test-domain.com", GitBranch: "main", Redirect: "other-domain.com", RedirectStatusCode: 307},
{Domain: "test-domain.com", RedirectStatusCode: 307},
}

domains := make([]interface{}, len(projectDomains))
Expand Down Expand Up @@ -85,8 +85,6 @@ func TestSetVercelConfig(t *testing.T) {

// Test domains
assert.Contains(t, component.Variables, "domain = \"test-domain.com\"")
assert.Contains(t, component.Variables, "git_branch = \"main\"")
assert.Contains(t, component.Variables, "redirect = \"other-domain.com\"")
assert.Contains(t, component.Variables, "redirect_status_code = 307")

}
Expand Down

0 comments on commit 20d0db2

Please sign in to comment.