Skip to content

Commit 4b35804

Browse files
committed
test(utils): fix test get repository
Unset GITHUB_REPOSITORY variable before running the test, This prevents the test from failing if the variable is available for some reason
1 parent 3b0cf88 commit 4b35804

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmd/utils_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,14 @@ func TestPRisDraft(t *testing.T) {
4343

4444
func TestGetRepository(t *testing.T) {
4545
t.Run("missing repository", func(t *testing.T) {
46+
_ = os.Unsetenv("GITHUB_REPOSITORY")
4647
want := errMissingRepository
4748
_, err := getRepository()
4849
if err != want {
4950
t.Fatalf("Expected error [ %v ], got [ %v ]", want, err)
5051
}
5152
})
53+
5254
t.Run("valid repository", func(t *testing.T) {
5355
want := "owner/repo"
5456
_ = os.Setenv("GITHUB_REPOSITORY", want)

0 commit comments

Comments
 (0)