mirror of
https://github.com/pestphp/pest.git
synced 2026-04-25 16:37:27 +02:00
add custom message to failed expectations
This commit is contained in:
@ -10,6 +10,10 @@ test('failures', function () {
|
||||
expect(['a', 'b', 'c'])->toEqual(['a', 'b']);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
test('failures with custom message', function () {
|
||||
expect(['a', 'b', 'c'])->toEqual(['a', 'b'], 'oh no!');
|
||||
})->throws(ExpectationFailedException::class, 'oh no!');
|
||||
|
||||
test('not failures', function () {
|
||||
expect('042')->not->toEqual(42);
|
||||
})->throws(ExpectationFailedException::class);
|
||||
|
||||
Reference in New Issue
Block a user