Skip to content

⚒️ Declare JsonRestfulPpiResponseFlusher #377

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

Conversation

StewEucen
Copy link
Contributor

@StewEucen StewEucen requested review from hecticme, a team and Copilot April 25, 2025 09:26
@StewEucen StewEucen self-assigned this Apr 25, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new JSON RESTful API response flusher that standardizes the JSON output for API responses and updates associated unit tests.

  • Added the implementation of JsonRestfulApiResponseFlusher in the production code.
  • Created comprehensive tests to validate the class’s functionality, including its content type and JSON generation behavior.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/tests/server/restfulapi/flushers/concretes/JsonRestfulApiResponseFlusher.js Added tests covering the flushResponseBody and generateJsonBody methods.
lib/server/restfulapi/flushers/concretes/JsonRestfulApiResponseFlusher.js Implemented the new JsonRestfulApiResponseFlusher class extending from BaseRestfulApiResponseFlusher.
Comments suppressed due to low confidence (1)

tests/tests/server/restfulapi/flushers/concretes/JsonRestfulApiResponseFlusher.js:97

  • Consider enhancing this test by asserting that expressResponse.json is called with the exact JSON output produced by generateJsonBody, instead of just verifying the call without arguments.
const generateJsonBodySpy = jest.spyOn(flusher, 'generateJsonBody')

@StewEucen StewEucen marked this pull request as ready for review April 25, 2025 09:26
Copy link

@arbredoux arbredoux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@StewEucen StewEucen force-pushed the declare/JsonRestfulApiResponseFlusher branch from ba87ee3 to 58d3d7f Compare April 25, 2025 09:29
@StewEucen StewEucen merged commit 99cfdcc into implement/family-of-RestfulApiResponseFlusher Apr 25, 2025
2 checks passed
@StewEucen StewEucen deleted the declare/JsonRestfulApiResponseFlusher branch April 25, 2025 09:38
StewEucen added a commit that referenced this pull request Apr 25, 2025
…onseFlusher

⚒️ Declare `JsonRestfulPpiResponseFlusher`
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.

2 participants