Skip to content

Commit

Permalink
fixup! Cleanup tests and remove unused pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
gandarez committed Jul 28, 2024
1 parent df38c70 commit deafaf7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/heartbeat/heartbeat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ func TestSendHeartbeats_RateLimited(t *testing.T) {
numCalls++
})

tmpFile, err := os.CreateTemp(t.TempDir(), "wakatime")
require.NoError(t, err)

defer tmpFile.Close()

v := viper.New()
v.SetDefault("sync-offline-activity", 1000)
v.Set("api-url", testServerURL)
Expand All @@ -156,6 +161,7 @@ func TestSendHeartbeats_RateLimited(t *testing.T) {
v.Set("timeout", 5)
v.Set("write", true)
v.Set("heartbeat-rate-limit-seconds", 500)
v.Set("internal-config", tmpFile.Name())
v.Set("internal.heartbeats_last_sent_at", time.Now().Add(-time.Minute).Format(time.RFC3339))

offlineQueueFile, err := os.CreateTemp(t.TempDir(), "")
Expand Down

0 comments on commit deafaf7

Please sign in to comment.