fix(Assertion): Refactor methods for setting failure and success messages

This commit is contained in:
Philipp Kunz 2024-08-24 01:42:17 +02:00
parent 4e9a7b5424
commit 689afcbd92
3 changed files with 9 additions and 3 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## 2024-08-24 - 1.2.1 - fix(Assertion)
Refactor methods for setting failure and success messages
- Renamed 'withFailMessage' to 'setFailMessage' for better readability and consistency.
- Renamed 'withSuccessMessage' to 'setSuccessMessage' to align with the naming convention.
## 2024-08-24 - 1.2.0 - feat(assertions)
Add custom fail and success messages for assertions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartexpect',
version: '1.2.0',
version: '1.2.1',
description: 'A testing library to manage expectations in code, offering both synchronous and asynchronous assertion methods.'
}

View File

@ -32,13 +32,13 @@ export class Assertion {
}
private failMessage: string;
public withFailMessage(failMessageArg: string) {
public setFailMessage(failMessageArg: string) {
this.failMessage = failMessageArg;
return this;
}
private successMessage: string;
public withSuccessMessage(successMessageArg: string) {
public setSuccessMessage(successMessageArg: string) {
this.successMessage = successMessageArg;
return this;
}