Skip to content

Commit 02dd2ec

Browse files
test: improve npm availability check in dependabot integration test (#7398)
1 parent 2766233 commit 02dd2ec

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

pkg/cli/compile_dependabot_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@ import (
1414
)
1515

1616
func TestCompileDependabotIntegration(t *testing.T) {
17-
// Check if npm is available
18-
if _, err := exec.LookPath("npm"); err != nil {
17+
// Check if npm is available and functional
18+
npmPath, err := exec.LookPath("npm")
19+
if err != nil {
1920
t.Skip("Skipping test - npm not available")
2021
}
22+
// Test if npm actually works
23+
cmd := exec.Command(npmPath, "--version")
24+
if err := cmd.Run(); err != nil {
25+
t.Skipf("Skipping test - npm is not functional: %v", err)
26+
}
2127

2228
// Create temp directory for test
2329
tempDir := testutil.TempDir(t, "test-*")

0 commit comments

Comments
 (0)