cli icon indicating copy to clipboard operation
cli copied to clipboard

Add unit tests for internal/service module

Open salignatmoandal opened this issue 7 months ago • 0 comments

What

This PR adds a comprehensive test suite for the internal/services module.

Why

  • Improves code reliability and maintainability
  • Makes future refactoring safer
  • Provides documentation for expected behavior

Details

  • Adds unit tests for:
    • Run()
    • CheckVersions()
    • listRemoteImages()
    • suggestUpdateCmd()
  • Uses afero.NewMemMapFs() for in-memory filesystem testing
  • Uses gock for HTTP request mocking
  • Uses testify for assertions

Result

  • Test coverage for the module is now above 90%
  • All tests pass locally

Let me know if you need any changes or improvements!

salignatmoandal avatar Jun 28 '25 18:06 salignatmoandal