Update type specifiers in validation logging #16173
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Noticed while debugging a validation issue with a full-content test I'm working on. The warning logged had some incorrect formatting.
I was receiving the following error, which I initially found confusing:
I tracked this down to the line of code:
According to the sprintf-js docs,
%o
is for an octal, so that explains the zeros. This PR changes the instances of%o
to%j
, which the library says will output a json representation of the parameter.Tested and I received a better error, still not perfect, but an improvement:
I imagine this came about because of an update to the library or change of library used for those messages.
How has this been tested?
Detailed above. I reproduced by creating a validation error in one of the full-content tests (adding an attribute that wasn't produced in the save content), and then regenerating the fixtures. Jest will output the error in the terminal.
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: