|
1 | | -import type { ContainerType, JSONRPCRequest } from '../../../Polykey/src/rpc/types'; |
| 1 | +import type { ContainerType, JSONRPCRequest } from '../../src/types'; |
2 | 2 | import type { ReadableStream } from 'stream/web'; |
3 | | -import type { JSONValue } from '../../../Polykey/src/types'; |
| 3 | +import type { JSONValue } from '../../src/types'; |
4 | 4 | import { TransformStream } from 'stream/web'; |
5 | 5 | import { fc, testProp } from '@fast-check/jest'; |
6 | 6 | import Logger, { LogLevel, StreamHandler } from '@matrixai/logger'; |
7 | | -import * as utils from '../../../Polykey/src/utils'; |
8 | | -import RPCServer from '../../../Polykey/src/rpc/RPCServer'; |
9 | | -import RPCClient from '../../../Polykey/src/rpc/RPCClient'; |
| 7 | +import * as rpcTestUtils from './utils'; |
| 8 | +import * as utils from '../../src/utils'; |
| 9 | +import RPCServer from '../../src/RPCServer'; |
| 10 | +import RPCClient from '../../src/RPCClient'; |
10 | 11 | import { |
11 | 12 | ClientHandler, |
12 | 13 | DuplexHandler, |
13 | 14 | RawHandler, |
14 | 15 | ServerHandler, |
15 | 16 | UnaryHandler, |
16 | | -} from '../../../Polykey/src/rpc/handlers'; |
| 17 | +} from '../../src/handlers'; |
17 | 18 | import { |
18 | 19 | ClientCaller, |
19 | 20 | DuplexCaller, |
20 | 21 | RawCaller, |
21 | 22 | ServerCaller, |
22 | 23 | UnaryCaller, |
23 | | -} from '../../../Polykey/src/rpc/callers'; |
24 | | -import * as rpcErrors from '../../../Polykey/src/rpc/errors'; |
25 | | -import * as rpcUtilsMiddleware from '../../../Polykey/src/rpc/utils/middleware'; |
26 | | -import * as rpcTestUtils from './utils'; |
| 24 | +} from '../../src/callers'; |
| 25 | +import * as rpcErrors from '../../src/errors'; |
| 26 | +import * as rpcUtilsMiddleware from '../../src/utils/middleware'; |
27 | 27 |
|
28 | 28 | describe('RPC', () => { |
29 | 29 | const logger = new Logger(`RPC Test`, LogLevel.WARN, [new StreamHandler()]); |
@@ -169,7 +169,7 @@ describe('RPC', () => { |
169 | 169 | rpcClient.methods.testMethod({ |
170 | 170 | hello: 'world', |
171 | 171 | }), |
172 | | - ).rejects.toThrow(rpcErrors.ErrorPolykeyRemote); |
| 172 | + ).rejects.toThrow(rpcErrors.ErrorRPCRemote); |
173 | 173 |
|
174 | 174 | await rpcServer.destroy(); |
175 | 175 | await rpcClient.destroy(); |
@@ -420,7 +420,7 @@ describe('RPC', () => { |
420 | 420 | }); |
421 | 421 |
|
422 | 422 | const callProm = rpcClient.methods.testMethod(value); |
423 | | - await expect(callProm).rejects.toThrow(rpcErrors.ErrorPolykeyRemote); |
| 423 | + await expect(callProm).rejects.toThrow(rpcErrors.ErrorRPCRemote); |
424 | 424 | await expect( |
425 | 425 | callProm.catch((e) => { |
426 | 426 | throw e.cause; |
@@ -476,7 +476,7 @@ describe('RPC', () => { |
476 | 476 | }); |
477 | 477 |
|
478 | 478 | const callProm = rpcClient.methods.testMethod(value); |
479 | | - await expect(callProm).rejects.toThrow(rpcErrors.ErrorPolykeyRemote); |
| 479 | + await expect(callProm).rejects.toThrow(rpcErrors.ErrorRPCRemote); |
480 | 480 | await expect( |
481 | 481 | callProm.catch((e) => { |
482 | 482 | throw e.cause; |
|
0 commit comments