feat(tapbundle): Add global postTask (teardown) and suite lifecycle hooks (beforeAll/afterAll) to tapbundle

This commit is contained in:
2025-11-20 18:22:54 +00:00
parent 8fd114334f
commit ca08bb2e3c
8 changed files with 873 additions and 246 deletions

View 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));
}
}