test: enhance error handling in RPC disconnected test

This commit is contained in:
2025-11-27 22:45:48 +08:00
parent e17a9591e1
commit 3a4a54d37c

View File

@@ -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
})
);
})
})