-
-
Notifications
You must be signed in to change notification settings - Fork 86
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
More details with JsonMatcher #191
Comments
Hey, with the latest version of php-matcher you can review the backtrace that can be printed on demand. |
I am facing the same issue. Supposing this expected JSON: {
"foo": "bar"
} if the actual value is {
"foo": "baz"
} the error messages are:
The v4 is not useful as it just shows expected and actual values, without details about where the mismatch was. Newlines are also stripped out, so big values become unreadable. Then the backtrace is
As the backtrace contains all mismatches (the ones from matchers that are not related to the pattern and the ones that actually failed), it is quite complicated to find the error, even in this trivial example. I couldn't find a way to get a precise error like v3.2 reported, is it still possible with v4? |
Hey However I’ll reopen this issue since it seems to be important and maybe someone else would find time to work on it |
Hey @norberttech. No worries! I'm happy to take a look, and have tried, but can't work it out so far. If you have any ideas to help me on my way I'd appreciate it! Thanks. |
Afaik that behavior changed to fix another nasty bug related to not precise error messages when other matchers failed but unfortunately it also affected JSON matches. I guess you might want to work on error message by extracting difference between pattern and value |
the causes look to be a combination of:
|
so I think I finally fixed that problem in #225, latest version was deployed and this is how it looks I'm closing this issue for now but feel free to let me know if I missed anything. |
Hello there,
using version 4.0 of coduo/php-matcher
Is there a way to get more details when JSON values do not match ?
Like the line that differ maybe ?
Because right now I have something like that :
Which is kind of difficult to debug.
Any suggestions ?
The text was updated successfully, but these errors were encountered: