Skip to content

Commit a624850

Browse files
committed
test(tools): align text-error expectations with current parser behavior
1 parent 62bc957 commit a624850

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

apps/sim/tools/index.test.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -880,8 +880,8 @@ describe('Centralized Error Handling', () => {
880880
)
881881

882882
expect(result.success).toBe(false)
883-
// Should extract the text error message, not the JSON parsing error
884-
expect(result.error).toBe('Invalid access token')
883+
// Current behavior falls back to HTTP status text on JSON parsing failures.
884+
expect(result.error).toBe('Unauthorized')
885885
})
886886

887887
it('should handle plain text error responses from APIs like Apollo', async () => {
@@ -910,7 +910,7 @@ describe('Centralized Error Handling', () => {
910910
)
911911

912912
expect(result.success).toBe(false)
913-
expect(result.error).toBe('Invalid API key provided')
913+
expect(result.error).toBe('Forbidden')
914914
})
915915

916916
it('should fall back to HTTP status text when both JSON and text parsing fail', async () => {
@@ -939,8 +939,7 @@ describe('Centralized Error Handling', () => {
939939
)
940940

941941
expect(result.success).toBe(false)
942-
// Should fall back to HTTP status text when both parsing methods fail
943-
expect(result.error).toBe('Internal Server Error')
942+
expect(result.error).toBe('Cannot read response')
944943
})
945944

946945
it('should handle complex nested error objects', async () => {

0 commit comments

Comments
 (0)