From 3a4a54d37c3e33527c119f5ea776726136b81b19 Mon Sep 17 00:00:00 2001 From: tone Date: Thu, 27 Nov 2025 22:45:48 +0800 Subject: [PATCH] test: enhance error handling in RPC disconnected test --- __tests__/e2e/rpc-disconnected.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/__tests__/e2e/rpc-disconnected.test.ts b/__tests__/e2e/rpc-disconnected.test.ts index e94ea73..e20fc5f 100644 --- a/__tests__/e2e/rpc-disconnected.test.ts +++ b/__tests__/e2e/rpc-disconnected.test.ts @@ -33,8 +33,11 @@ describe('Rpc disconnected test', () => { errorCode: RPCErrorCode.CONNECTION_DISCONNECTED }) ); - await expect(callPromise).rejects.toBeInstanceOf(RPCError); - await expect(callPromise).rejects - .toHaveProperty('errorCode', RPCErrorCode.CONNECTION_DISCONNECTED); + await expect(callPromise).rejects.toMatchObject( + expect.objectContaining({ + constructor: RPCError, + errorCode: RPCErrorCode.CONNECTION_DISCONNECTED + }) + ); }) })