feat(tapbundle): Add global postTask (teardown) and suite lifecycle hooks (beforeAll/afterAll) to tapbundle
This commit is contained in:
21
ts_tapbundle/tapbundle.classes.posttask.ts
Normal file
21
ts_tapbundle/tapbundle.classes.posttask.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import * as plugins from './tapbundle.plugins.js';
|
||||
import { TapTools } from './tapbundle.classes.taptools.js';
|
||||
|
||||
export interface IPostTaskFunction {
|
||||
(tapTools?: TapTools): Promise<any>;
|
||||
}
|
||||
|
||||
export class PostTask {
|
||||
public description: string;
|
||||
public postTaskFunction: IPostTaskFunction;
|
||||
|
||||
constructor(descriptionArg: string, postTaskFunctionArg: IPostTaskFunction) {
|
||||
this.description = descriptionArg;
|
||||
this.postTaskFunction = postTaskFunctionArg;
|
||||
}
|
||||
|
||||
public async run() {
|
||||
console.log(`::__POSTTASK: ${this.description}`);
|
||||
await this.postTaskFunction(new TapTools(null));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user