chore: adjusts tests

This commit is contained in:
Nuno Maduro
2024-06-27 01:41:34 +01:00
parent 5c3bf469d5
commit 474b9b7e17
10 changed files with 41 additions and 14 deletions

View File

@ -21,6 +21,7 @@
SELECTION OPTIONS:
--bail ........................... Stop execution upon first not-passed test
--todos ........................ Output to standard output the list of todos
--notes ......................... Output to standard output tests with notes
--retry Run non-passing tests first and stop execution upon first error or failure
--list-suites ................................... List available test suites
--testsuite [name] ......... Only run tests from the specified test suite(s)

View File

@ -928,6 +928,11 @@
✓ it can handle a non-defined exception
✓ it can handle a class not found Error
PASS Tests\Features\Expect\toUseTrait
✓ pass
✓ failures
✓ not failures
PASS Tests\Features\Expect\unless
✓ it pass
✓ it failures
@ -992,6 +997,31 @@
✓ a "describe" group of tests → it is a test
✓ a "describe" group of tests → it is a higher order message test
PASS Tests\Features\Note
✓ it may have a static note
// This is before each static note
// This is a note
// This is before each runtime note
✓ it may have a runtime note
// This is before each static note
// This is before each runtime note
// This is a runtime note
✓ it may have static note and runtime note
// This is before each static note
// This is a static note
// This is before each runtime note
// This is a runtime note
✓ nested → it may have static note and runtime note
// This is describe static note
// This is a static note within describe
// This is before each runtime note
// This is a runtime note within describe
✓ multiple notes
// This is before each static note
// This is before each runtime note
// This is a runtime note
// This is another runtime note
NOTI Tests\Features\Notices
! notice → This is a notice description // tests/Features/Notices.php:4
! a "describe" group of tests → notice → This is a notice description // tests/Features/Notices.php:11
@ -1470,4 +1500,4 @@
WARN Tests\Visual\Version
- visual snapshot of help command output
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1049 passed (2577 assertions)
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 24 skipped, 1057 passed (2588 assertions, 18 notes)

View File

@ -29,6 +29,8 @@ describe('nested', function () {
})->note('This is describe static note');
test('multiple notes', function () {
expect(true)->toBeTrue(true);
$this->note([
'This is a runtime note',
'This is another runtime note',

View File

@ -17,5 +17,5 @@ it('ensures the given closures reports the correct class name and suggests the [
$this->get();
})->throws(
Error::class,
'Call to undefined method Tests\Unit\Support\ExceptionTrace::get(). Did you forget to use the [uses()] function? Read more at: https://pestphp.com/docs/configuring-tests',
'Call to undefined method Tests\Unit\Support\ExceptionTrace::get(). Did you forget to use the [pest()->extend()] function? Read more at: https://pestphp.com/docs/configuring-tests',
);

View File

@ -16,7 +16,7 @@ $run = function () {
test('parallel', function () use ($run) {
expect($run('--exclude-group=integration'))
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1035 passed (2545 assertions)')
->toContain('Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 1043 passed (2556 assertions)')
->toContain('Parallel: 3 processes');
})->skipOnWindows();