diff --git a/changelog.md b/changelog.md index db38a3b..db488f7 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # Changelog +## 2025-03-17 - 5.6.0 - feat(tap) +Add explicit fail method to the Tap class for better test failure handling + +- Introduced fail() method that throws a custom error message to explicitly mark test failures +- Improves clarity in test flow by giving developers a direct way to trigger error states + ## 2025-03-08 - 5.5.10 - fix(node) Removed unused jest dependency from project. diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 3027d59..3ea9df1 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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.' } diff --git a/ts/tapbundle.classes.tap.ts b/ts/tapbundle.classes.tap.ts index 05ddc4b..f124a2d 100644 --- a/ts/tapbundle.classes.tap.ts +++ b/ts/tapbundle.classes.tap.ts @@ -160,6 +160,14 @@ export class Tap { 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();