cordova-plugin-vibration
cordova-plugin-vibration copied to clipboard
refactor: vibration tests to reduce redundancy and improve readability
Platforms affected
JavaScript (test.js)
Motivation and Context
This refactoring improves the readability and maintainability of the vibration test code by consolidating repetitive functions and reducing redundancy.
Description
- Refactored code to streamline vibration test functions and minimize duplication.
- Reorganized HTML generation and action button creation to improve clarity.
- Simplified the cancellation logic and optimized timeout handling.
Testing
Manually verified vibration functionality across tests, ensuring both initiation and cancellation work as expected for all supported patterns.
Checklist
- [x] I've run the tests to ensure all new and existing tests pass.
- [ ] I added automated test coverage where applicable.
- [ ] Commit is prefixed with
(js)
as this change affects all JavaScript platforms supporting vibration. - [ ] If this Pull Request resolves an issue, I linked to the issue in the text above.
- [ ] I've updated the documentation if necessary.