Skip to content

test: mock create-pr git subprocess calls#756

Open
sanmaxdev wants to merge 1 commit into
OWASP:mainfrom
sanmaxdev:test/mock-create-pr-git
Open

test: mock create-pr git subprocess calls#756
sanmaxdev wants to merge 1 commit into
OWASP:mainfrom
sanmaxdev:test/mock-create-pr-git

Conversation

@sanmaxdev

Copy link
Copy Markdown

Summary

Reworks the create-pr helper tests so git subprocess behavior is mocked in-process instead of creating and committing in a temporary git repository.

Why this change

The staging test no longer depends on machine-level git author configuration.

What changed

  • Mocked node:child_process for create-pr helper tests.
  • Replaced the temp git repository setup with assertions against the expected git add calls.
  • Added branch-name subprocess assertions for the existing-branch path.

Validation

  • npm run build
  • npm test -- --runInBand tests/create-pr.test.ts
  • node dist/index.js advisories sync
  • npm test -- --runInBand

User-facing impact

Does this change:

  • affect scanning behavior
  • affect output formatting
  • affect JSON output
  • affect docs only

Notes

Closes #754

@sanmaxdev sanmaxdev force-pushed the test/mock-create-pr-git branch from 2256925 to 44772b3 Compare June 25, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: mock git subprocess calls in create-pr.test.ts

1 participant