File tree 1 file changed +12
-4
lines changed
components/usage/pkg/stripe 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ package stripe
7
7
import (
8
8
"context"
9
9
"fmt"
10
+ "os"
10
11
"testing"
11
12
12
13
"github.com/stretchr/testify/require"
@@ -86,14 +87,21 @@ func TestCustomerQueriesForTeamIds_MultipleQueries(t *testing.T) {
86
87
}
87
88
88
89
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
91
96
}
92
- c , err := New (config )
97
+
98
+ c , err := New (ClientConfig {
99
+ SecretKey : secretKey ,
100
+ })
93
101
if err != nil {
94
102
t .Error (err )
95
103
}
96
- invoice , err := c .GetLatestInvoice (context .Background (), "sub_1LRu1YGadRXm50o3WFaXl2Pg" )
104
+ invoice , err := c .GetLatestInvoice (context .Background (), teamId )
97
105
if err != nil {
98
106
t .Error (err )
99
107
}
You can’t perform that action at this time.
0 commit comments