feat(core): Implement Protocol V2 with enhanced settings and lifecycle hooks
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user