fix(core): update
This commit is contained in:
15
test/test.ts
15
test/test.ts
@ -31,11 +31,24 @@ tap.test('should add some handlers', async () => {
|
||||
}));
|
||||
})
|
||||
|
||||
tap.test('first test', async (tools) => {
|
||||
tap.test('should create Server and Client', async (tools) => {
|
||||
testTypedSocketServer = await typedsocket.TypedSocket.createServer(testTypedRouter);
|
||||
testTypedSocketClient = await typedsocket.TypedSocket.createClient(testTypedRouter, 'http://localhost');
|
||||
});
|
||||
|
||||
tap.test('should process messages from both sides', async () => {
|
||||
const myServerSideTypedRequest = testTypedSocketServer.createTypedRequest<IRequest_Client_Server>('sayhi');
|
||||
const myClientSideTypedRequest = testTypedSocketClient.createTypedRequest<IRequest_Client_Server>('sayhi');
|
||||
const response = await myClientSideTypedRequest.fire({
|
||||
greeting: 'that is a greeting from the client'
|
||||
});
|
||||
console.log(response);
|
||||
const response2 = await myServerSideTypedRequest.fire({
|
||||
greeting: 'that is a greeting from the server'
|
||||
});
|
||||
console.log(response2);
|
||||
})
|
||||
|
||||
tap.test('should run without problems for a little bit', async tools => {
|
||||
await tools.delayFor(5000);
|
||||
})
|
||||
|
Reference in New Issue
Block a user