feat(tap): Add explicit fail method to the Tap class for better test failure handling
This commit is contained in:
@@ -160,6 +160,14 @@ export class Tap<T> {
|
||||
public threw(err: Error) {
|
||||
console.log(err);
|
||||
}
|
||||
|
||||
/**
|
||||
* Explicitly fail the current test with a custom message
|
||||
* @param message - The failure message to display
|
||||
*/
|
||||
public fail(message: string = 'Test failed'): never {
|
||||
throw new Error(message);
|
||||
}
|
||||
}
|
||||
|
||||
export let tap = new Tap();
|
||||
|
||||
Reference in New Issue
Block a user