Skip to content

Improve test structure and mocking approach#962

Merged
threeal merged 1 commit into
mainfrom
improve-tests
May 21, 2026
Merged

Improve test structure and mocking approach#962
threeal merged 1 commit into
mainfrom
improve-tests

Conversation

@threeal
Copy link
Copy Markdown
Owner

@threeal threeal commented May 21, 2026

Summary

  • Replace process.env.INPUT_PATH hacks with vi.mock("gha-utils") to properly mock getInput at the module level
  • Use a local .main.test.tmp directory (in src/) instead of os.tmpdir(), scoped to the test file
  • Reset process.exitCode in beforeEach instead of manually at the end of one test
  • Use named imports from node:fs/promises in both main.ts and main.test.ts

Test plan

  • All tests pass (pnpm test)
  • Pre-commit hook passes (lefthook run pre-commit --all-files)

🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
@threeal threeal self-assigned this May 21, 2026
@threeal threeal added the enhancement New feature or request label May 21, 2026
@threeal threeal added this to the Version 3.1.1 milestone May 21, 2026
@threeal threeal merged commit 32efb55 into main May 21, 2026
4 checks passed
@threeal threeal deleted the improve-tests branch May 21, 2026 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant