diff --git a/pkg/cli/compile_dependabot_test.go b/pkg/cli/compile_dependabot_test.go index 761f4392e4..74de60e0d0 100644 --- a/pkg/cli/compile_dependabot_test.go +++ b/pkg/cli/compile_dependabot_test.go @@ -14,10 +14,16 @@ import ( ) func TestCompileDependabotIntegration(t *testing.T) { - // Check if npm is available - if _, err := exec.LookPath("npm"); err != nil { + // Check if npm is available and functional + npmPath, err := exec.LookPath("npm") + if err != nil { t.Skip("Skipping test - npm not available") } + // Test if npm actually works + cmd := exec.Command(npmPath, "--version") + if err := cmd.Run(); err != nil { + t.Skipf("Skipping test - npm is not functional: %v", err) + } // Create temp directory for test tempDir := testutil.TempDir(t, "test-*")