Skip to content

Commit

Permalink
refactor(binding-http): re-introduce proper error message check
Browse files Browse the repository at this point in the history
  • Loading branch information
danielpeintner committed Oct 10, 2023
1 parent 7cbe593 commit e6a2be7
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/binding-http/test/http-client-basic-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,11 @@ class HttpClientBasicTest {
try {
await this.client.readResource({ href: "https://127.0.0.1:3001" });
} catch (error) {
// Note: depending on Node.js version different errors appear
// AssertionError: expected 'request to https://127.0.0.1:3001/ fa…' to deeply equal 'Client error: Unauthorized'
// error.message.should.eql("Client error: Unauthorized");
if (error instanceof Error) {
error.message.should.eql("Client error: Unauthorized");
} else {
fail("No proper error instance object");
}
return;
}
fail("should fail to authorize client with basic");
Expand Down

0 comments on commit e6a2be7

Please sign in to comment.