Skip to content
Permalink
Browse files

Fix: multiple message in TAP formatter (fixes #4975)

Support multiple message in TAP formatter

The current implementation only display one message.
  • Loading branch information...
SimonDegraeve committed Jan 16, 2016
1 parent 1fc80e9 commit b8fbaa0eaaf4cf790c3051457a7c7f70a6b54df5
Showing with 13 additions and 1 deletion.
  1. +4 −1 lib/formatters/tap.js
  2. +9 −0 tests/lib/formatters/tap.js
@@ -66,7 +66,10 @@ module.exports = function(results) {
// The first error will be logged as message key
// This is to adhere to TAP 13 loosely defined specification of having a message key
if ("message" in diagnostics) {
diagnostics.messages = [diagnostic];
if (typeof diagnostics.messages === "undefined") {
diagnostics.messages = [];
}
diagnostics.messages.push(diagnostic);
} else {
diagnostics = diagnostic;
}
@@ -91,6 +91,12 @@ describe("formatter:tap", function() {
line: 6,
column: 11,
ruleId: "bar"
}, {
message: "Unexpected baz.",
severity: 1,
line: 7,
column: 12,
ruleId: "baz"
}]
}];

@@ -104,6 +110,9 @@ describe("formatter:tap", function() {
assert.include(result, "Unexpected bar.");
assert.include(result, "line: 6");
assert.include(result, "column: 11");
assert.include(result, "Unexpected baz.");
assert.include(result, "line: 7");
assert.include(result, "column: 12");
});
});

0 comments on commit b8fbaa0

Please sign in to comment.
You can’t perform that action at this time.