mirror of
https://github.com/bitsocialnet/5chan.git
synced 2026-08-03 07:41:04 +02:00
fix(desktop): start PKC RPC with configured options
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
import { startPkcRpcServer } from './start-pkc-rpc-core.js';
|
||||
|
||||
describe('startPkcRpcServer', () => {
|
||||
it('passes the Electron data path through pkcOptions', async () => {
|
||||
const pkcOptions = {
|
||||
dataPath: '/tmp/5chan-pkc',
|
||||
kuboRpcClientsOptions: [{ url: 'http://localhost:50019/api/v0' }],
|
||||
};
|
||||
const server = {
|
||||
on: vi.fn(),
|
||||
ws: { on: vi.fn() },
|
||||
};
|
||||
const PKCRpcModule = {
|
||||
PKCWsServer: vi.fn(async () => server),
|
||||
};
|
||||
|
||||
await startPkcRpcServer({
|
||||
PKCRpcModule,
|
||||
port: 9138,
|
||||
pkcOptions,
|
||||
authKey: 'test-auth-key',
|
||||
logger: { log: vi.fn() },
|
||||
});
|
||||
|
||||
expect(PKCRpcModule.PKCWsServer).toHaveBeenCalledWith({
|
||||
port: 9138,
|
||||
pkcOptions,
|
||||
authKey: 'test-auth-key',
|
||||
});
|
||||
expect(PKCRpcModule.PKCWsServer.mock.calls[0][0]).not.toHaveProperty('pkc');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user