Skip to content

Commit d159eea

Browse files
committed
fixup! [New] parsers.all augments suggestion code output
1 parent f9c785e commit d159eea

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

tests/helpers/parsers.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,24 @@ const parsers = {
8080
&& {
8181
errors: testObject.errors.map(
8282
(errorObject) => {
83+
const nextSuggestions = errorObject.suggestions && {
84+
suggestions: errorObject.suggestions.map(
85+
(suggestion) => {
86+
const nextSuggestion = Object.assign(
87+
{},
88+
suggestion,
89+
{ output: suggestion.output + extraComment }
90+
);
91+
92+
return nextSuggestion;
93+
}
94+
),
95+
};
96+
8397
const nextErrorObject = Object.assign(
8498
{},
8599
errorObject,
86-
errorObject.suggestions
87-
? {
88-
suggestions: errorObject.suggestions.map(
89-
(suggestion) => {
90-
const nextSuggestion = Object.assign(
91-
{},
92-
suggestion,
93-
{ output: suggestion.output + extraComment }
94-
);
95-
96-
return nextSuggestion;
97-
}
98-
),
99-
}
100-
: undefined
100+
nextSuggestions
101101
);
102102

103103
return nextErrorObject;

0 commit comments

Comments
 (0)