Support custom errors message

This commit is contained in:
João Neves 2022-11-22 15:55:08 +00:00
parent e559b37b72
commit a0f5706319
2 changed files with 181 additions and 169 deletions

View file

@ -1799,3 +1799,11 @@ test('assert', t => {
t.true(is.string(badlyTypedVariable));
}
});
test('assert-custom-message', t => {
const errorMessage = 'Custom error message';
const error = t.throws(() => {
assert.truthy(false, errorMessage);
});
t.is(error?.message, errorMessage);
});