Skip to content

Commit 2b8e998

Browse files
committed
fixup
1 parent d999593 commit 2b8e998

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

components/usage/pkg/stripe/stripe_test.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package stripe
77
import (
88
"context"
99
"fmt"
10+
"os"
1011
"testing"
1112

1213
"github.com/stretchr/testify/require"
@@ -86,14 +87,21 @@ func TestCustomerQueriesForTeamIds_MultipleQueries(t *testing.T) {
8687
}
8788

8889
func TestGetLatestInvoice(t *testing.T) {
89-
config := ClientConfig{
90-
SecretKey: "",
90+
secretKey := os.Getenv("TEST_KEY_STRIPE")
91+
teamId := os.Getenv("TEST_TEAM_ID")
92+
93+
if secretKey == "" || teamId == "" {
94+
t.Skip("Skipping because of missing EnvVars: TEST_TEAM_ID, TEST_KEY_STRIPE")
95+
return
9196
}
92-
c, err := New(config)
97+
98+
c, err := New(ClientConfig{
99+
SecretKey: secretKey,
100+
})
93101
if err != nil {
94102
t.Error(err)
95103
}
96-
invoice, err := c.GetLatestInvoice(context.Background(), "sub_1LRu1YGadRXm50o3WFaXl2Pg")
104+
invoice, err := c.GetLatestInvoice(context.Background(), teamId)
97105
if err != nil {
98106
t.Error(err)
99107
}

0 commit comments

Comments
 (0)