Pass validation errors with InvalidMessage error

Pass the array describing the validation errors occuring with the
InvalidMessage error throw and print it to the console.
This commit is contained in:
Hornwitser committed 2020-04-02 14:39:18 +02:00
1 parent 0a9fff7578
commit 43ce6aa58c
3 files changed
+14 -7

No files matched your search

+2 -2
View File
@@ -90,7 +90,7 @@ describe("lib/link/link", function() {
it("should throw on invalid message", function() {
assert.throws(
() => testLink.processMessage({ data: "invalid message" }),
new errors.InvalidMessage("Malformed")
{ message: "Malformed" }
);
});
it("should throw on message without validator", function() {
@@ -102,7 +102,7 @@ describe("lib/link/link", function() {
it("should throw on message failing validation", function() {
assert.throws(
() => testLink.processMessage({ seq: 1, type: 'simple', data: { string: 1 }}),
new errors.InvalidMessage("Validation failed for simple")
{ message: "Validation failed for simple" }
);
});
it("should throw on unhandled message", function() {