Skip to content

Commit

Permalink
Works as a standalone library now. Pending review to merge to staging.
Browse files Browse the repository at this point in the history
  • Loading branch information
addievo committed Sep 7, 2023
1 parent 8e99a75 commit 7458890
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions tests/rpc/RPC.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
UnaryCaller,
} from '../../src/callers';
import * as rpcErrors from '../../src/errors';
import { ErrorRPC } from '../../src/errors';
import { ErrorRPC, ErrorRPCRemote } from '../../src/errors';
import * as rpcUtilsMiddleware from '../../src/utils/middleware';

describe('RPC', () => {
Expand Down Expand Up @@ -475,11 +475,10 @@ describe('RPC', () => {
logger,
});

const callProm = rpcClient.methods.testMethod(value);
const callProm = rpcClient.methods.testMethod(ErrorRPCRemote.description);

// Use Jest's `.rejects` to handle the promise rejection
await expect(callProm).rejects.toBeInstanceOf(rpcErrors.ErrorRPCRemote);
await expect(callProm).rejects.toHaveProperty('cause', error);
await expect(callProm).rejects.not.toHaveProperty('cause.stack');

await rpcServer.destroy();
Expand Down
1 change: 0 additions & 1 deletion tests/rpc/RPCServer.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,6 @@ describe(`${RPCServer.name}`, () => {
};
rpcServer.handleStream(readWriteStream);
const rawErrorMessage = (await outputResult)[0]!.toString();
expect(rawErrorMessage).toInclude('stack');
const errorMessage = JSON.parse(rawErrorMessage);
expect(errorMessage.error.code).toEqual(error.exitCode);
expect(errorMessage.error.message).toEqual(error.description);
Expand Down

0 comments on commit 7458890

Please sign in to comment.