feat(core): Implement Protocol V2 with enhanced settings and lifecycle hooks

This commit is contained in:
2025-05-26 04:02:32 +00:00
parent 91880f8d42
commit 33d2ff1d4f
24 changed files with 2356 additions and 441 deletions

View File

@@ -22,6 +22,10 @@ export class TapTools {
public testData: any = {};
private static _sharedContext = new Map<string, any>();
private _snapshotPath: string = '';
// Flags for skip/todo
private _isSkipped = false;
private _skipReason?: string;
constructor(TapTestArg: TapTest<any>) {
this._tapTest = TapTestArg;
@@ -45,9 +49,33 @@ export class TapTools {
* skip the rest of the test
*/
public skip(reason?: string): never {
this._isSkipped = true;
this._skipReason = reason;
const skipMessage = reason ? `Skipped: ${reason}` : 'Skipped';
throw new SkipError(skipMessage);
}
/**
* Mark test as skipped without throwing (for pre-marking)
*/
public markAsSkipped(reason?: string): void {
this._isSkipped = true;
this._skipReason = reason;
}
/**
* Check if test is marked as skipped
*/
public get isSkipped(): boolean {
return this._isSkipped;
}
/**
* Get skip reason
*/
public get skipReason(): string | undefined {
return this._skipReason;
}
/**
* conditionally skip the rest of the test