This commit is contained in:
2025-08-23 11:29:22 +00:00
parent 92cbc4e543
commit 234aab74d6
16 changed files with 10068 additions and 2037 deletions

View File

@@ -1,8 +1,8 @@
import { expect, tap } from '@pushrocks/tapbundle';
import { expect, tap } from '@git.zone/tstest/tapbundle';
import * as smartipc from '../ts/index';
import * as smartspawn from '@pushrocks/smartspawn';
import * as smartpromise from '@pushrocks/smartpromise';
import * as smartspawn from '@push.rocks/smartspawn';
import * as smartpromise from '@push.rocks/smartpromise';
let serverIpc: smartipc.SmartIpc;
let clientIpc: smartipc.SmartIpc;
@@ -10,27 +10,27 @@ let clientIpc: smartipc.SmartIpc;
tap.test('should instantiate a valid instance', async () => {
serverIpc = new smartipc.SmartIpc({
ipcSpace: 'testSmartIpc',
type: 'server'
type: 'server',
});
serverIpc.registerHandler({
keyword: 'hi',
handlerFunc: data => {
handlerFunc: (data) => {
console.log(data);
}
},
});
await serverIpc.start();
});
tap.test('should create a client', async tools => {
tap.test('should create a client', async (tools) => {
clientIpc = new smartipc.SmartIpc({
ipcSpace: 'testSmartIpc',
type: 'client'
type: 'client',
});
await clientIpc.start();
clientIpc.sendMessage('hi', { awesome: 'yes' });
});
tap.test('should terminate the smartipc process', async tools => {
tap.test('should terminate the smartipc process', async (tools) => {
await clientIpc.stop();
await serverIpc.stop();
tools.delayFor(2000).then(() => {