-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add option to force require()
for config files handling
#42
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Updated `extractVideoId` tests to check various YouTube domains. * Added validation for URLs converted to URL objects. * Expanded error checks in `extractVideoId` tests.
* Added tests for `ProgressBar` initialization and formatting. * Expanded `createLogFile` tests for default and custom prefixes. * Improved `createDirIfNotExist` and `createDirIfNotExistSync` tests for directory creation and validation.
- Expanded `importConfig` tests to cover JSON, ES Module, and CommonJS formats. - Added test cases to ensure proper error handling for invalid config file paths and unknown extensions. - Introduced tests for `parseConfig` to validate both simple and resolved configurations. - Extended `resolveConfig` tests to verify audio conversion options and handling of nullable values. - Added `configChecker` tests to enforce type checks and unknown option validation. - Updated temporary file handling for better isolation and cleanup.
- Added unit tests for `splitOptions`, `writeErrorLog`, and `createConversionProgress` functions. - Improved coverage for `checkFfmpeg` and `resolveOptions` with more edge case scenarios. - Refactored `checkFfmpeg` tests to use temporary paths and stubs for `child_process.spawnSync`. - Added thorough validation for error logging with `writeErrorLog`. - Ensured robust handling and testing of conversion progress reporting. - Exported `splitOptions`, `createConversionProgress`, and `writeErrorLog` functions from `audioconv` module for testing use. Improves overall test coverage and ensures better reliability of the `audioconv` module.
- Introduced new test cases for the `convertAudio` function to ensure robust error handling and correct execution: - Test to verify that an error is thrown when the input file does not exist. - Test to check rejection when `ffmpeg` is not installed or correctly set up. - Test to confirm that `ffmpeg` chain pre-setup passes without errors when valid options are provided. - Mocked dependencies and environment variables to isolate tests and avoid side effects. These additions significantly improve the test coverage for critical scenarios within the `convertAudio` function, ensuring greater reliability and stability in the `audioconv` module.
- Refactored tests for better readability and maintainability. - Added new `describe` blocks for new test cases covering audio conversion and error handling scenarios. - Implemented stubs for `console.log` and `console.error` to suppress output during tests. - Improved test cases for file operations and audio conversion validation. - Improved error handling in the `convertAudio` function by safely retrieving the input file size. This prevents potential crashes if the input file is deleted unexpectedly. - Enhanced logging of error details, including input file size and better error context. - Added a `.mocharc.js` configuration file to standardize Mocha test settings. - Added sample audio file `testaudio-160-pcm_s32le.wav` for testing purposes.
- Enabled `check-coverage` to enforce code coverage thresholds. - Excluded `.mocharc.js` and temporary files (`tmp/**`) from coverage reporting.
- Added `forceRequire` parameter to `parseConfig` and `importConfig` functions. - Enabled forcing the use of `require()` for configuration files, regardless of their extension. - Improved compatibility with Windows by replacing backslashes with forward slashes when using `import()`.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #42 +/- ##
===========================================
+ Coverage 41.78% 66.02% +24.24%
===========================================
Files 7 7
Lines 414 418 +4
===========================================
+ Hits 173 276 +103
+ Misses 241 142 -99
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Moved to #43