Skip to content

Commit 287ae00

Browse files
committed
fix: tests
1 parent 0b7b2a1 commit 287ae00

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

.github/pre-commit/internal/checks/makewrap/makewrap_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@ func TestFumptCheck_Run_NoMake(t *testing.T) {
5858
err = os.Chdir(tmpDir)
5959
require.NoError(t, err)
6060

61+
// Initialize git repository
62+
require.NoError(t, exec.Command("git", "init").Run())
63+
require.NoError(t, exec.Command("git", "config", "user.email", "test@example.com").Run())
64+
require.NoError(t, exec.Command("git", "config", "user.name", "Test User").Run())
65+
6166
check := NewFumptCheck()
6267
ctx := context.Background()
6368

@@ -86,6 +91,11 @@ func TestFumptCheck_Run_NoTarget(t *testing.T) {
8691
err = os.Chdir(tmpDir)
8792
require.NoError(t, err)
8893

94+
// Initialize git repository
95+
require.NoError(t, exec.Command("git", "init").Run())
96+
require.NoError(t, exec.Command("git", "config", "user.email", "test@example.com").Run())
97+
require.NoError(t, exec.Command("git", "config", "user.name", "Test User").Run())
98+
8999
// Create a Makefile without fumpt target
90100
makefile := `
91101
test:

0 commit comments

Comments
 (0)