sdk/test/test.ts

29 lines
685 B
TypeScript
Raw Normal View History

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-07-04 16:42:41 +00:00
import { TypedRouter } from '@apiglobal/typedrequest';
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-07-04 16:42:41 +00:00
public slug: 'testapi';
public typedrouter = new TypedRouter();
2020-07-04 14:38:25 +00:00
public async checkReqirements() {
return {
allOk: true,
2020-07-04 14:50:24 +00:00
reason: '',
};
2020-07-04 14:38:25 +00:00
}
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();