2020-10-06 15:56:00 +00:00
|
|
|
import { expect, tap } from '@pushrocks/tapbundle';
|
|
|
|
import * as deesComms from '../ts/index';
|
|
|
|
|
|
|
|
let deesCommsTest: deesComms.DeesComms;
|
|
|
|
|
2020-10-06 17:18:20 +00:00
|
|
|
tap.test('first test', async (tools) => {
|
2020-10-06 15:56:00 +00:00
|
|
|
deesCommsTest = new deesComms.DeesComms();
|
2020-10-06 17:18:20 +00:00
|
|
|
deesCommsTest.createTypedHandler<any>('test', async (requestData) => {
|
2020-10-06 21:49:03 +00:00
|
|
|
return {'hitheretoo': 'greetings'};
|
2020-10-06 17:18:20 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
// lets fire a request
|
|
|
|
const typedrequest = deesCommsTest.createTypedRequest<any>('test');
|
2020-10-06 21:49:03 +00:00
|
|
|
const result = await typedrequest.fire({
|
|
|
|
'hithere': 'hello'
|
2020-10-06 17:18:20 +00:00
|
|
|
});
|
2020-10-06 21:49:03 +00:00
|
|
|
console.log(JSON.stringify(result));
|
2020-10-06 15:56:00 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
tap.start();
|