31 lines
755 B
TypeScript
31 lines
755 B
TypeScript
import { expect, tap } from '@pushrocks/tapbundle';
|
|
import * as sdk from '../ts/index';
|
|
import { ISimpleRequest } from '@tsclass/tsclass/dist_ts/network';
|
|
|
|
tap.test('should create a valid Handler', async () => {
|
|
class MyHandler extends sdk.AAgHandler<any> {
|
|
slug: 'testapi';
|
|
public async handleRequest(authInfo: sdk.AuthInfo<any>, request: ISimpleRequest) {
|
|
// this.authenticationHandler
|
|
let response: any;
|
|
return response;
|
|
}
|
|
public async checkReqirements() {
|
|
return {
|
|
allOk: true,
|
|
reason: '',
|
|
};
|
|
}
|
|
|
|
public async start() {}
|
|
|
|
public async stop() {}
|
|
}
|
|
|
|
const myHandlerInstance = new MyHandler();
|
|
|
|
expect(myHandlerInstance).to.be.instanceOf(sdk.AAgHandler);
|
|
});
|
|
|
|
tap.start();
|