Skip to content

Commit

Permalink
Added some comments for future
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotforbes committed Mar 22, 2023
1 parent 52cce78 commit 420c5bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,13 @@ var _ = Describe("Config", func() {

func TestGetConfigAPIHost(t *testing.T) {
t.Run("tests that we correctly get the config api host when the host is not the default one", func(t *testing.T) {
// if the host isn't equal to `https://circleci.com` then this is likely a server instance and
// wont have the api.X.com subdomain so we should instead just respect the host for config commands
host := cmd.GetConfigAPIHost(&settings.Config{Host: "test"})
assert.Equal(t, host, "test")

// If the host passed in is the same as the defaultHost 'https://circleci.com' - then we know this is cloud
// and as such should use the `api.circleci.com` subdomain
host = cmd.GetConfigAPIHost(&settings.Config{Host: "https://circleci.com", ConfigAPIHost: "https://api.circleci.com"})
assert.Equal(t, host, "https://api.circleci.com")
})
Expand Down

0 comments on commit 420c5bd

Please sign in to comment.