Skip to content

Refactor holidays #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 13, 2025
Merged

Refactor holidays #45

merged 6 commits into from
Jan 13, 2025

Conversation

laendoor
Copy link
Member

I'll create a clear PR description based on the git diff, using Markdown formatting.

PR Description

Changes

  • Refactored holidays functionality with improved code organization and testing

    • Created new Holidays-v2 class with cleaner API and better separation of concerns
    • Added new HolidaysController to handle holiday-related Telegram commands
    • Implemented helper functions in separate helpers.ts file for better code reusability
  • Added comprehensive test coverage for holidays functionality

    • Added fixture files for Argentina and Canada holiday data
    • Created unit tests for helper functions, holidays controller, and core functionality
    • Improved test organization and readability
  • Updated development configuration

    • Removed .tool-versions in favor of Volta for Node.js version management
    • Added Volta configuration (Node.js 20.10.0, Yarn 1.22.22)
    • Updated VS Code settings for Markdown linting
  • Added Codacy badges to README for code quality and coverage tracking

Technical Details

  • Created new types for holiday-related data structures
  • Improved error handling and date manipulation
  • Added proper TypeScript types throughout the codebase
  • Implemented consistent date formatting and calculations
  • Added support for ISO date strings in holiday information

Testing

  • Added test fixtures for Argentina and Canada holiday data (2023-2024)
  • Created unit tests for:
    • Markdown escaping functionality
    • Date formatting and calculations
    • Holiday data fetching and processing
    • Long weekend calculations

The changes improve code maintainability, testability, and provide better type safety while maintaining existing functionality.

Copy link

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+20.93% (target: -1.00%) 98.11%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (716a6c6) 203 121 59.61%
Head commit (57d2629) 185 (-18) 149 (+28) 80.54% (+20.93%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#45) 53 52 98.11%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

@laendoor laendoor merged commit 1ef3774 into main Jan 13, 2025
3 of 4 checks passed
@laendoor laendoor deleted the refactor-holidays branch January 13, 2025 00:33
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.

1 participant