Closed ezenity closed 11 months ago
@ezenity thank you for your submission. Currently tests not passing.
@ezenity thank you for your submission. Currently tests not passing.
I did same manual testing to see if I could reproduce this failed workflow. Here are my results.
Build (18.x)
Build (16.x)
After doing further analysis, I found what is causing this error.
I am using features from ES2017 (ie. async/await) and possibly features from ES2020. Since ESLint is complaining about syntax it doesn't understand, my assumption is it is linting against ES6 features only. By setting a specific supported ecmaVersion, this would resolve error message.
I will push the change to .eslintrc.yml
Enabled Actions on forked repo and confirmed both workflows pass successfully:
This commit encompasses a comprehensive refactoring and extension of the test suite for the jsonapi-query-parameters ruleset. The following changes have been made:
Common Setup: Moved the common setup logic into a
beforeEach
block to avoid redundancy. The Spectral ruleset is now set up once for all test cases.beforeEach
.Async/Await: Replaced callback-based asynchronous code with
async/await
for better readability and error handling.done()
callbacks.async/await
.Parameterized Test Cases: Introduced parameterized test cases for different scenarios, making the test suite more exhaustive.
Error Handling: Improved error handling by throwing errors and providing detailed error messages.
done(error)
for error handling.throw new Error(error)
.Error Verification: Added checks for error codes and severity levels, ensuring that the right types of errors are being thrown.
Code Comments: Added comments to describe the purpose and context of each test case.
Code Formatting: Improved code formatting and structure for better readability.
By making these changes, the test suite is now more robust, easier to understand, and covers more edge cases. This sets a strong foundation for future development and debugging.