Skip to content

Conversation

rom1504
Copy link
Member

@rom1504 rom1504 commented Sep 7, 2025

GitHub Actions Fix + Unit Tests

  • 🔧 CRITICAL: Update actions/setup-node from deprecated @v1.4.4 to @v4
  • 🧪 Add comprehensive Jest test suite for updator script
  • 🎯 Test all automation functionality: version updates, package.json, CI workflows
  • 🛡️ Mock all external dependencies for reliable testing

Test Coverage

  • Version addition to testedVersions array
  • README.md version range updates
  • CI workflow modifications for new versions
  • Package.json dependency updates
  • Git operations (branching, commits, pushes)
  • PR creation with metadata
  • Error handling for file/git operations
  • Input validation and sanitization

Critical Fix

The deprecated actions/[email protected] was causing workflow warnings and potential future failures. Updated to @v4 for reliability.

Benefits

  • ✅ Reliable automation with up-to-date GitHub Actions
  • 🔍 Comprehensive test coverage prevents regressions
  • 🛠️ Easier maintenance with documented test scenarios

- Update actions/setup-node to @v4 (was deprecated @v1.4.4)
- Add comprehensive Jest test suite for updator script
- Test version handling, package.json updates, CI workflow modifications
- Mock all external dependencies and file operations
- Cover error scenarios and input validation
Copy link

socket-security bot commented Sep 7, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedgh-helpers@​1.0.0751007984100
Addednyc@​15.1.09710010081100
Addedsinon@​17.0.21001009886100
Addedmocha@​10.8.2971009494100

View full report

rom1504 and others added 3 commits September 7, 2025 15:11
- Replace Jest with Mocha + Sinon for better compatibility
- All 13 tests passing covering full automation functionality
- Test version handling, package updates, CI modifications, error scenarios
… tests

- Extract and export testable functions from updator.js
- Add graceful gh-helpers import with fallback mock
- Create comprehensive unit tests that import and test actual implementation
- Include tests for sanitizeVersion, updateVersionFile, updateReadmeFile, updateCIFile, updatePackageJson, generateBranchName, createPRBody functions
- Add integration tests for full workflow validation
- Set up proper test infrastructure with Mocha + Sinon
- Add .nyc_output to .gitignore to exclude test coverage cache

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@rom1504
Copy link
Member Author

rom1504 commented Sep 7, 2025

Too complex, not convinced

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