[BUG] Missing test coverage for --output=overwrite path in optimize command
Describe the bug.
While running npm run test --if-present, I noticed that the test coverage for src/apps/cli/commands/optimize.ts is quite low.
Specifically, there does not seem to be any test covering the following execution path:
asyncapi optimize file.yml --output=overwrite --no-tty
This code path overwrites the original AsyncAPI file in place. Since this behavior is not currently covered by any automated test, regressions in this area could potentially go unnoticed.
Expected behavior
When the optimize command is executed with --output=overwrite --no-tty, the original AsyncAPI file should be overwritten correctly. This behavior should be validated by an automated test to ensure future changes do not accidentally break or alter this functionality.
Screenshots
N/A
How to Reproduce
- Run: npm run test --if-present
- Check the coverage report
- Observe that optimize.ts has low coverage and that the --output=overwrite path is not exercised
🖥️ Device Information [optional]
- Operating System (OS): macOS
- Browser: N/A
- Browser Version: N/A
👀 Have you checked for similar open issues?
- [x] I checked and didn't find similar issue
🏢 Have you read the Contributing Guidelines?
- [x] I have read the Contributing Guidelines
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
hey @AayushSaini101, @Amzani, @Shurtu-gal, @Souvikns . This is my first PR in this repo, so I’d really appreciate a review and any guidance if there’s something I should improve or do differently. Happy to make changes if needed. Thanks a lot!
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience :heart: