Compare commits

...

5 Commits

Author SHA1 Message Date
705f19dd87 release: v2.9.4 2023-07-22 09:42:37 -05:00
5637dfa75d fix: test description on beforeEach failure 2023-07-22 09:33:41 -05:00
cf5275293f fix: snapshots directory 2023-07-20 13:47:23 -05:00
81efe5953b release: v2.9.2 2023-07-20 13:35:03 -05:00
a37a3b9f99 fix: non-working beforeEach 2023-07-20 13:27:41 -05:00
9 changed files with 52 additions and 14 deletions

View File

@ -2,13 +2,41 @@
## Unreleased
## [v2.9.4 (2023-07-22)](https://github.com/pestphp/pest/compare/v2.9.3...v2.9.4)
### Fixed
- Output on `describe` `beforeEach` failure ([5637dfa](https://github.com/pestphp/pest/commit/5637dfa75d1a331adc810935536cde7c3196af06))
## [v2.9.3 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.2...v2.9.3)
### Fixed
- Snapshots directory on Windows environments ([cf52752](https://github.com/pestphp/pest/commit/cf5275293fe693ec2cf4dbadbadae01daaa08169))
## [v2.9.2 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.1...v2.9.2)
### Fixed
- `beforeEach` on Windows environments ([a37a3b9](https://github.com/pestphp/pest/commit/a37a3b9f9931bc1ab1ea9e1d6d38dfb55dde3f74))
## [v2.9.1 (2023-07-20)](https://github.com/pestphp/pest/compare/v2.9.0...v2.9.1)
TODO
### Chore
- Bumps PHPUnit to `^10.2.6` ([8fdb0b3](https://github.com/pestphp/pest/commit/8fdb0b3d32ce9ee12bd182f22751c2b41a53e97b))
## [v2.9.0 (2023-07-19)](https://github.com/pestphp/pest/compare/v2.8.1...v2.9.0)
TODO
> "Spicy Summer" is the codename assigned to Pest 2.9, for full details check our announcement: [https://pestphp.com/docs/pest-spicy-summer-release](https://pestphp.com/docs/pest-spicy-summer-release)
### Added
- Built-in Snapshot Testing ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
- Describe Blocks ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
- Architectural Testing++ ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
- Type Coverage Plugin ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
- Drift Plugin ([c828756](https://github.com/pestphp/pest/commit/c8287567eb8c3dbea5845b2a6f70804b094b4b60))
## [v2.8.1 (2023-06-20)](https://github.com/pestphp/pest/compare/v2.8.0...v2.8.1)

View File

@ -185,6 +185,10 @@ trait Testable
{
TestSuite::getInstance()->test = $this;
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
$this->__description = self::$__latestDescription = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
parent::setUp();
$beforeEach = TestSuite::getInstance()->beforeEach->get(self::$__filename)[1];
@ -234,10 +238,6 @@ trait Testable
*/
private function __resolveTestArguments(array $arguments): array
{
$method = TestSuite::getInstance()->tests->get(self::$__filename)->getMethod($this->name());
$this->__description = self::$__latestDescription = $this->dataName() ? $method->description.' with '.$this->dataName() : $method->description;
$underlyingTest = Reflection::getFunctionVariable($this->__test, 'closure');
$testParameterTypes = array_values(Reflection::getFunctionArguments($underlyingTest));

View File

@ -6,7 +6,7 @@ namespace Pest;
function version(): string
{
return '2.9.1';
return '2.9.4';
}
function testDirectory(string $file = ''): string

View File

@ -115,7 +115,7 @@ final class Backtrace
continue;
}
if (str_contains($trace['file'], 'pest/src')) {
if (str_contains($trace['file'], 'pest'.DIRECTORY_SEPARATOR.'src')) {
continue;
}

View File

@ -76,8 +76,10 @@ final class TestSuite
$this->afterEach = new AfterEachRepository();
$this->afterAll = new AfterAllRepository();
$this->rootPath = (string) realpath($rootPath);
$this->snapshots = new SnapshotRepository($this->rootPath.'/'.$this->testPath, '.pest/snapshots');
$this->snapshots = new SnapshotRepository(
implode(DIRECTORY_SEPARATOR, [$this->rootPath, $this->testPath]),
implode(DIRECTORY_SEPARATOR, ['.pest', 'snapshots']),
);
}
/**

View File

@ -1,5 +1,5 @@
Pest Testing Framework 2.9.1.
Pest Testing Framework 2.9.4.
USAGE: pest <file> [options]

View File

@ -1,3 +1,3 @@
Pest Testing Framework 2.9.1.
Pest Testing Framework 2.9.4.

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');