Skip to content

Commit

Permalink
Improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
felixge committed Apr 19, 2021
1 parent 1aa0f15 commit c43d1d3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion profiler/profiler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,21 @@ func TestStart(t *testing.T) {
mu.Unlock()
})

t.Run("options/GoodAPIKey", func(t *testing.T) {
t.Run("options/GoodAPIKey/Agent", func(t *testing.T) {
err := Start(WithAPIKey("12345678901234567890123456789012"))
defer Stop()
assert.Nil(t, err)
assert.Equal(t, activeProfiler.cfg.agentURL, activeProfiler.cfg.targetURL)
})

t.Run("options/GoodAPIKey/Agentless", func(t *testing.T) {
err := Start(
WithAPIKey("12345678901234567890123456789012"),
WithAgentlessUpload(),
)
defer Stop()
assert.Nil(t, err)
assert.Equal(t, activeProfiler.cfg.apiURL, activeProfiler.cfg.targetURL)
})

t.Run("options/BadAPIKey", func(t *testing.T) {
Expand Down

0 comments on commit c43d1d3

Please sign in to comment.