Open Adagedo opened 1 month ago
I'm pretty sure the error message is dependent on your environment since it's thrown directly by JSON.parse.
I'd be tempted to just expect.stringContaining("SyntaxError")
it to be honest.
I have suspicions on my environment though I was not too certain.
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.