wp-cli-tests icon indicating copy to clipboard operation
wp-cli-tests copied to clipboard

Improve Behat output to include diffs on failed comparisons

Open schlessera opened this issue 7 years ago • 1 comments

When Behat compares two elements and finds them to not match, it would be helpful for debugging purposes to have a diff available that shows the exact difference between the two elements, like in this example output:

image 2018-08-16 at 9 21 38 am

The SebastianBergmann\Diff\Differ class is available and can be used for that.

schlessera avatar Aug 16 '18 07:08 schlessera

Looks like an upcoming Behat release will have better diffs out of the box, see https://github.com/Behat/Behat/pull/1532

Not in v3.16 yet, so have to wait for the next one.

Requires PHP 7.2+ though, see https://github.com/wp-cli/wp-cli-tests/pull/228

Alternatively we can copy that logic of course.

swissspidy avatar Dec 11 '24 09:12 swissspidy