We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
With using a mixed-in expectation object, method chaining results in IDE type errors:
expect($response->content()) ->toBeJson() ->json() ->not()->toHaveKey('errors') ->toHaveKey('data') ->data->toEqual(...); // ^ IDE type error occurs
pest/src/Mixins/Expectation.php
Line 60 in b33af71
Suggested fix:
- * @return self<TValue> * @return $this
Changing the PHPDoc return type to $this seems to be a better solution to avoid these IDE type errors.
$this
expect($response->content()) ->toBeJson() ->json() ->not()->toHaveKey('errors') ->toHaveKey('data') ->data->toEqual([]);
The suggested fix above solves the problem:
No response
2.x-dev
8.2.15
Linux
pestphp/pest-plugin version is v2.1.1
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
What Happened
With using a mixed-in expectation object, method chaining results in IDE type errors:
pest/src/Mixins/Expectation.php
Line 60 in b33af71
Suggested fix:
Changing the PHPDoc return type to
$this
seems to be a better solution to avoid these IDE type errors.How to Reproduce
The suggested fix above solves the problem:
Sample Repository
No response
Pest Version
2.x-dev
PHP Version
8.2.15
Operation System
Linux
Notes
pestphp/pest-plugin version is v2.1.1
The text was updated successfully, but these errors were encountered: