Right now, TestResponse::assertJson(Fragment) shows a colorless, single-line diff of the expected versus actual JSON. I would like to contribute a better method of diffing, that uses multiple lines and colors to make the difference more visually discernible.
Here is an example of how a Ruby testing framework does it. You can immediately see which JSON fields didn't match the expectation.
Does this idea fit in the Laravel roadmap? If yes, I have a few questions about how to go about contributing this:
Is it okay to use a small diffing library, or to optionally depend on system diff or git commands (and fall back on the current diff implementation if not present)? Or should I implement it from scratch?
Right now,
TestResponse::assertJson
(Fragment
) shows a colorless, single-line diff of the expected versus actual JSON. I would like to contribute a better method of diffing, that uses multiple lines and colors to make the difference more visually discernible.Here is an example of how a Ruby testing framework does it. You can immediately see which JSON fields didn't match the expectation.![image](https://user-images.githubusercontent.com/8157262/110858856-e1dfca80-82ba-11eb-9dea-91b81c2386a6.png)
Does this idea fit in the Laravel roadmap? If yes, I have a few questions about how to go about contributing this:
diff
orgit
commands (and fall back on the current diff implementation if not present)? Or should I implement it from scratch?