feat(tap): Add explicit fail method to the Tap class for better test failure handling

This commit is contained in:
2025-03-17 14:42:18 +00:00
parent 30ec6c5bc2
commit 281c203e5c
3 changed files with 15 additions and 1 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/tapbundle',
version: '5.5.10',
version: '5.6.0',
description: 'A comprehensive testing automation library that provides a wide range of utilities and tools for TAP (Test Anything Protocol) based testing, especially suitable for projects using tapbuffer.'
}

View File

@ -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();