fix: test description on beforeEach failure

This commit is contained in:
Nuno Maduro
2023-07-22 09:33:41 -05:00
parent cf5275293f
commit 5637dfa75d
3 changed files with 14 additions and 6 deletions

View File

@ -1052,6 +1052,7 @@
✓ it can return an array of all test suite filenames
PASS Tests\Visual\BeforeEachTestName
✓ description
✓ latest description
PASS Tests\Visual\Collision
@ -1084,4 +1085,4 @@
WARN Tests\Visual\Version
- visual snapshot of help command output
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 742 passed (1787 assertions)
Tests: 2 deprecated, 4 warnings, 5 incomplete, 2 notices, 13 todos, 19 skipped, 743 passed (1788 assertions)

View File

@ -1,6 +1,13 @@
<?php
beforeEach(fn () => $this->latestDescription = self::$__latestDescription);
beforeEach(function () {
$this->description = $this->__description;
$this->latestDescription = self::$__latestDescription;
});
test('description', function () {
expect($this->description)->toBe('description');
});
test('latest description', function () {
expect($this->latestDescription)->toBe('latest description');