-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- token removed from code, can be injected at compile time - if token is empty, disable analytics - no need for dev/prod token separation, if it is getting injected Signed-off-by: James Nesbitt <[email protected]>
- Loading branch information
1 parent
79f17f5
commit 4b48a5d
Showing
2 changed files
with
11 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,9 @@ func TestIdentifyAnalyticsUser(t *testing.T) { | |
} | ||
|
||
func TestDefaultClient(t *testing.T) { | ||
sc, _ := NewSegmentClient("AAAAAAAAA") | ||
defaultClient.AnalyticsClient = sc | ||
|
||
userConfig := user.Config{ | ||
Name: "John Doe", | ||
Email: "[email protected]", | ||
|
@@ -102,6 +105,7 @@ func TestDefaultClient(t *testing.T) { | |
t.Run("Analytics enabled", func(t *testing.T) { | ||
old := defaultClient.IsEnabled | ||
Enabled(true) | ||
|
||
defer Enabled(old) | ||
|
||
TrackEvent("foobar", nil) | ||
|