2020-03-24 23:32:43 +00:00
|
|
|
import { expect, tap } from '@pushrocks/tapbundle';
|
|
|
|
import * as sdk from '../ts/index';
|
2020-03-25 15:16:03 +00:00
|
|
|
import { ISimpleRequest } from '@tsclass/tsclass/dist_ts/network';
|
2020-03-24 23:32:43 +00:00
|
|
|
|
2020-03-25 15:16:03 +00:00
|
|
|
tap.test('should create a valid Handler', async () => {
|
2020-03-25 20:15:46 +00:00
|
|
|
class MyHandler extends sdk.AAgHandler<any> {
|
2020-03-25 15:16:03 +00:00
|
|
|
slug: 'testapi';
|
2020-03-25 20:15:46 +00:00
|
|
|
public async handleRequest(authInfo: sdk.AuthInfo<any>, request: ISimpleRequest) {
|
2020-03-25 15:16:03 +00:00
|
|
|
// this.authenticationHandler
|
|
|
|
let response: any;
|
|
|
|
return response;
|
|
|
|
}
|
2020-07-04 14:38:25 +00:00
|
|
|
public async checkReqirements() {
|
|
|
|
return {
|
|
|
|
allOk: true,
|
|
|
|
reason: ''
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public async start() {}
|
|
|
|
|
|
|
|
public async stop() {}
|
2020-03-25 15:16:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const myHandlerInstance = new MyHandler();
|
|
|
|
|
|
|
|
expect(myHandlerInstance).to.be.instanceOf(sdk.AAgHandler);
|
2020-03-24 23:32:43 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
tap.start();
|