diff --git a/apps/server/tests/unit/services/claude-usage-service.test.ts b/apps/server/tests/unit/services/claude-usage-service.test.ts index 024c4e3a..07ad13c9 100644 --- a/apps/server/tests/unit/services/claude-usage-service.test.ts +++ b/apps/server/tests/unit/services/claude-usage-service.test.ts @@ -518,7 +518,11 @@ Resets in 2h const promise = ptyService.fetchUsageData(); - dataCallback!('authentication_error'); + // Send data containing the authentication error pattern the service looks for + dataCallback!('"type":"authentication_error"'); + + // Trigger the exit handler which checks for auth errors + exitCallback!({ exitCode: 1 }); await expect(promise).rejects.toThrow( "Claude CLI authentication issue. Please run 'claude logout' and then 'claude login' in your terminal to refresh permissions."