Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexTugarev committed Aug 23, 2022
1 parent 10389ce commit 053e2ab
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions components/usage/pkg/stripe/stripe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package stripe
import (
"context"
"fmt"
"os"
"testing"

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

func TestGetLatestInvoice(t *testing.T) {
config := ClientConfig{
SecretKey: "",
secretKey := os.Getenv("TEST_KEY_STRIPE")
teamId := os.Getenv("TEST_TEAM_ID")

if secretKey == "" || teamId == "" {
t.Skip("Skipping because of missing EnvVars: TEST_TEAM_ID, TEST_KEY_STRIPE")
return
}
c, err := New(config)

c, err := New(ClientConfig{
SecretKey: secretKey,
})
if err != nil {
t.Error(err)
}
invoice, err := c.GetLatestInvoice(context.Background(), "sub_1LRu1YGadRXm50o3WFaXl2Pg")
invoice, err := c.GetLatestInvoice(context.Background(), teamId)
if err != nil {
t.Error(err)
}
Expand Down

0 comments on commit 053e2ab

Please sign in to comment.