From e7d5e7eb2b2fccf78af2f6780c33765e17617a2f Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 13:36:05 +0100 Subject: [PATCH] test: tighten oauth lock timeout assertion --- .../oauth-lock-timeout-classification.test.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/agents/auth-profiles/oauth-lock-timeout-classification.test.ts b/src/agents/auth-profiles/oauth-lock-timeout-classification.test.ts index 2a2b3f835c8..ba5aab24390 100644 --- a/src/agents/auth-profiles/oauth-lock-timeout-classification.test.ts +++ b/src/agents/auth-profiles/oauth-lock-timeout-classification.test.ts @@ -42,13 +42,10 @@ describe("OAuth refresh lock timeout classification", () => { const error = buildRefreshContentionError({ provider, profileId, cause }); - expect(error).toMatchObject({ - code: "refresh_contention", - cause: { - code: FILE_LOCK_TIMEOUT_ERROR_CODE, - lockPath: `${refreshLockPath}.lock`, - }, - }); + expect(error.code).toBe("refresh_contention"); + expect(error.cause).toBe(cause); + expect(cause.code).toBe(FILE_LOCK_TIMEOUT_ERROR_CODE); + expect(cause.lockPath).toBe(`${refreshLockPath}.lock`); expect(error.message).toContain("another process is already refreshing"); expect(error.message).toContain("Please wait for the in-flight refresh to finish and retry."); });