fix: --dry-run with --json output #8567
Open
+1
−1
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.
This broke in 10.4. Before 10.4
npm install --dry-run --json
would return JSON. After 10.4 it no longer returns JSON.c209e98#r165769221
Note: This is the smallest change and I didn't update any tests. Nor was I sure where to one. The fact that it broke means there was no test for this before.
If it was up to me I think I'd add a
summary.diff = []
and push the diffs on there. And then only at the end where it outputssummary
, if you want diff output to stdout then map oversummary.diff
. That would put the checks for output in a single place.References
Fixeds #8565