refactor: overhaul test suite and application architecture #15

Merged
eleith merged 5 commits from gemini/feature/test-refactoring into main 2025-07-24 16:38:44 +00:00
5 Commits
Author SHA1 Message Date
eleith 3e3e9fb6be refactor: complete application-wide refactoring
- Deletes the old top-level config files
- Updates the remaining service files (`archive`, `category`, `email`, `processor`) to align with the new dependency injection structure
- Modifies the `preview-miniflux-email` script to use the new application factory
2025-07-24 16:11:41 +00:00
eleith 1ace8118cf refactor(tests): unify and centralize mocks
- Moves all service mocks (`MinifluxClient`, `ArchiveService`, `EmailService`) to the `internal/testutil` package
- Expands the mock data factories in `testutil` to include `NewMockCategory`, `NewMockEntry`, and `NewMockFeedIcon`
- Refactors all tests to use the new centralized mocks and data factories
- This reduces code duplication and improves the consistency and maintainability of the test suite
2025-07-24 16:08:06 +00:00
eleith 2b52c50b23 test(coverage): increase coverage for processor and app
- Adds a new test to `processor_test.go` to cover the error handling path for `MarkCategoryAsRead`
- Adds a new test file, `miniflux_client_wrapper_test.go`, to provide dedicated coverage for the `MinifluxClientWrapper`
- Increases total test coverage from 71.4% to 72.4%
2025-07-24 16:07:07 +00:00
eleith 17abae5055 refactor: move to cmd-based layout and dependency injection
- Moves the main application entry point to `cmd/miniflux-digest`
- Introduces an `internal/app` package to house the core application struct and service interfaces
- Implements dependency injection to make the application more modular and testable
- Updates the `Dockerfile` to build the new application structure
2025-07-24 16:05:17 +00:00
eleith 52a8959820 feat(coverage): add flexible test coverage script
- Introduces `check-coverage.sh` to handle test coverage reporting
- Adds `--mode` flag to switch between package and function-level reports
- `make test-coverage` provides a package-level summary for CI
- `make test-coverage-full` provides a detailed function-level report for local development
2025-07-24 16:02:03 +00:00