Commit bc657d03 authored by David Sveningsson's avatar David Sveningsson

fix(reporter): fix {error,warning}Count after merging reports

parent b1306a4a
......@@ -42,8 +42,10 @@ describe("Reporter", () => {
"barney",
"wilma",
]);
expect(merged.results[0].errorCount).toEqual(3);
expect(merged.results[1].filePath).toEqual("bar");
expect(merged.results[1].messages.map(x => x.message)).toEqual(["spam"]);
expect(merged.results[1].errorCount).toEqual(1);
});
});
......
......@@ -80,7 +80,16 @@ export class Reporter {
}
});
});
return { valid, results: Object.keys(merged).map(key => merged[key]) };
const results: Result[] = Object.values(merged).map((result: Result) => {
/* recalculate error- and warning-count */
result.errorCount = countErrors(result.messages);
result.warningCount = countWarnings(result.messages);
return result;
});
return {
valid,
results,
};
}
public add(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment