-
-
Notifications
You must be signed in to change notification settings - Fork 355
New issue
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
Add name to description for named datasets #134
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great to me. 👍 Just wondering if there is ever a time when you would just want the name, without the list of data, probably not though. 🤔
Hmm... With the data, it can make for very long output lines - which you don't care about much if the test passed. But if a test fails, it's nice to see the data that failed, not just the name, in the context of the test suite output. And "only sometimes" would be a bigger refactor. |
Fair enough, that's fine. 👍 All good in my opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sshead Can you rebase this pull request? Also, can you add a test that actually uses the feature and prints the output to the snapshot?
39eca9c
to
18292f0
Compare
Let me know if this wasn't what you were after, or if there's anything else I need to do. (I'm such a part-time "not my day job" dev that this is the first time I've ever force-pushed ... hope I didn't break the world 😅) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me, just left a comment.
tests/Unit/Datasets.php
Outdated
'two' => [[2]], | ||
])); | ||
|
||
$this->assertSame('test description with data set "one" (1)', $descriptions[0]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you use the expectation API here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
b010a49
to
36fd18b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ready to merge and tag.
@sshead Congrats, great contribution. |
With named datasets, Pest does not currently include the dataset name in test output. This PR inserts the dataset name in the dataset description, so that the output of both the test result and failure messages mimic the PHPUnit format.
For example, given the test:
the current output includes:
With this PR, the new output is:
The PHPUnit failure output, for a test equivalent to the above, is: