test: add custom message test case for assert
This commit is contained in:
parent
4364c7264b
commit
441a25ed78
@ -10,6 +10,11 @@ describe("assert", () => {
|
||||
it('assert should throw an error with default message when condition is falsy', () => {
|
||||
expect(() => assert(false)).toThrowError("condition is not truthy");
|
||||
});
|
||||
|
||||
it('assert should throw an error with custom message when condition is falsy', () => {
|
||||
const errorMessage = "Custom error message";
|
||||
expect(() => assert(false, errorMessage)).toThrowError(errorMessage);
|
||||
});
|
||||
});
|
||||
|
||||
describe("assertDefined", () => {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user