You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to put together a PR to improve the output of failed expectsOutput or expectsOutputContains when testing artisan commands. However I am not completely satisfied with the PR yet and would like some help, especially with the Mockery-parts.
Please see the draft PR here, along with some questions: Krisell#2
For context – here's the planned PR description
Currently, when testing artisan commands and using expectsOutput or expectsOutputContains, the error message on a failed expectation is not as helpful as it could be.
Before:
1) Tests\Feature\TestExpectedOutput::email_sent_test
Output "Email sent to 17 users." was not printed.
After:
1) Tests\Feature\TestExpectedOutput::email_sent_test
Output "Email sent to 17 users." was not printed.
Actual output:
"Email sent to 23 users."
Previously, the developer didn't know if no output was generated at all or almost the correct output was generated. If there is indeed no output, that is also mentioned with this PR:
1) Tests\Feature\TestExpectedOutput::email_sent_test
Output "Email sent to 17 users." was not printed.
No output was printed.
Of course, if there are multiple lines of output, all are displayed.
1) Tests\Feature\TestExpectedOutput::email_sent_test
Output "User with id 3 was updated" was not printed.
Actual output:
"Starting process ..."
"User with id 5 was updated."
"All done!"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi all,
I am trying to put together a PR to improve the output of failed
expectsOutput
orexpectsOutputContains
when testing artisan commands. However I am not completely satisfied with the PR yet and would like some help, especially with the Mockery-parts.Please see the draft PR here, along with some questions: Krisell#2
For context – here's the planned PR description
Currently, when testing artisan commands and using
expectsOutput
orexpectsOutputContains
, the error message on a failed expectation is not as helpful as it could be.Before:
After:
Previously, the developer didn't know if no output was generated at all or almost the correct output was generated. If there is indeed no output, that is also mentioned with this PR:
Of course, if there are multiple lines of output, all are displayed.
Beta Was this translation helpful? Give feedback.
All reactions