You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running tests for the FetchBaseQuery with a non-JSON body, there is a mismatch in the expected and received error messages. Specifically, the error formatting differs in how it handles unexpected tokens in the response.
Expected Error
"error": "SyntaxError: Unexpected token h in JSON at position 1"
Recieved Error
"error": "SyntaxError: Unexpected token 'h', \"this is not json!\" is not valid JSON"
Test Case:
This occurs in the test fetchBaseQuery › non-JSON-body › success: should fail gracefully (default="json" responseHandler) at line 176 in src/query/tests/fetchBaseQuery.test.tsx.
174|expect(res.meta?.request).toBeInstanceOf(Request)
➤ YN0000: 175|expect(res.meta?.response).toBeInstanceOf(Object)➤YN0000: >176|expect(res.error).toEqual({➤YN0000: |^➤YN0000: 177|status: 'PARSING_ERROR',➤YN0000: 178|error: 'SyntaxError: Unexpected token h in JSON at position 1',➤YN0000: 179|originalStatus: 200,➤YN0000:
Impact:
While this test failure does not affect runtime behavior, it might introduce inconsistencies between the expected and actual error handling, potentially impacting robustness in error reporting.
This mismatch may cause confusion when debugging errors in production, as error messages are not formatted as expected.
The text was updated successfully, but these errors were encountered:
When running tests for the FetchBaseQuery with a non-JSON body, there is a mismatch in the expected and received error messages. Specifically, the error formatting differs in how it handles unexpected tokens in the response.
Expected Error
Recieved Error
Test Case:
This occurs in the test fetchBaseQuery › non-JSON-body › success: should fail gracefully (default="json" responseHandler) at line 176 in src/query/tests/fetchBaseQuery.test.tsx.
Impact:
While this test failure does not affect runtime behavior, it might introduce inconsistencies between the expected and actual error handling, potentially impacting robustness in error reporting.
This mismatch may cause confusion when debugging errors in production, as error messages are not formatted as expected.
The text was updated successfully, but these errors were encountered: