fix(core): update

This commit is contained in:
2020-12-26 18:45:17 +00:00
parent f18be49423
commit ab2b068ac4
3 changed files with 137 additions and 180 deletions

View File

@ -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);
})