Skip to content

Commit

Permalink
Unit test for the new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
koresar committed Jan 9, 2024
1 parent a27effd commit 9068a5e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions test/client/AllserverClient.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe("AllserverClient", () => {
const result = await AllserverClient({ transport: MockedTransport() }).introspect();
assert.strictEqual(result.success, false);
assert.strictEqual(result.code, "ALLSERVER_CLIENT_INTROSPECTION_FAILED");
assert.strictEqual(result.message, "Couldn't introspect void://localhost");
assert.strictEqual(result.message, "Couldn't introspect void://localhost due to: Cannot reach server");
assert.strictEqual(result.error.message, "Cannot reach server");
});

Expand Down Expand Up @@ -168,7 +168,7 @@ describe("AllserverClient", () => {
const result = await AllserverClient({ transport: MockedTransport() }).call("foo", {});
assert.strictEqual(result.success, false);
assert.strictEqual(result.code, "ALLSERVER_CLIENT_PROCEDURE_UNREACHABLE");
assert.strictEqual(result.message, "Couldn't reach remote procedure: foo");
assert.strictEqual(result.message, "Couldn't reach remote procedure foo due to: Cannot reach server");
assert.strictEqual(result.error.message, "Cannot reach server");
});

Expand All @@ -183,7 +183,7 @@ describe("AllserverClient", () => {
assert.strictEqual(Reflect.has(client, "foo"), false); // still don't have it
assert.strictEqual(result.success, false);
assert.strictEqual(result.code, "ALLSERVER_CLIENT_PROCEDURE_UNREACHABLE");
assert.strictEqual(result.message, "Couldn't reach remote procedure: foo");
assert.strictEqual(result.message, "Couldn't reach remote procedure foo due to: Shit happens too");
assert.strictEqual(result.error.message, "Shit happens too");
});
});
Expand Down Expand Up @@ -298,7 +298,7 @@ describe("AllserverClient", () => {
assert.deepStrictEqual(result, {
success: false,
code: "ALLSERVER_CLIENT_MIDDLEWARE_ERROR",
message: "The 'before' middleware error while calling 'foo' procedure",
message: "The 'before' middleware error while calling 'foo' procedure: 'before' is throwing",
error: err,
});
});
Expand Down Expand Up @@ -399,7 +399,7 @@ describe("AllserverClient", () => {
assert.deepStrictEqual(result, {
success: false,
code: "ALLSERVER_CLIENT_MIDDLEWARE_ERROR",
message: "The 'after' middleware error while calling 'foo' procedure",
message: "The 'after' middleware error while calling 'foo' procedure: 'after' is throwing",
error: err,
});
});
Expand Down Expand Up @@ -459,7 +459,7 @@ describe("AllserverClient", () => {
assert.deepStrictEqual(result, {
success: false,
code: "ALLSERVER_CLIENT_MIDDLEWARE_ERROR",
message: "The 'before' middleware error while calling 'foo' procedure",
message: "The 'before' middleware error while calling 'foo' procedure: 'before' is throwing",
error: err,
});
});
Expand Down

0 comments on commit 9068a5e

Please sign in to comment.