Skip to content

Commit

Permalink
refactor: Minor fixes to #181 for types and new typescript version.
Browse files Browse the repository at this point in the history
  • Loading branch information
jwalton committed Sep 21, 2021
1 parent 449f5db commit e2e6491
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/AmqpConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ export interface IAmqpConnectionManager {
addListener(event: 'unblocked', listener: () => void): this;
addListener(event: 'disconnect', listener: (arg: { err: Error }) => void): this;

listeners(eventName: string | symbol): any;
// eslint-disable-next-line @typescript-eslint/ban-types
listeners(eventName: string | symbol): Function[];

on(event: string, listener: (...args: any[]) => void): this;
on(event: 'connect', listener: ConnectListener): this;
Expand Down
2 changes: 1 addition & 1 deletion test/AmqpConnectionManagerTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ describe('AmqpConnectionManager', function () {
let err;
try {
await amqp.connect({ timeout: 0.1 });
} catch (error) {
} catch (error: any) {
err = error;
}
expect(err.message).to.equal('amqp-connection-manager: connect timeout');
Expand Down
2 changes: 1 addition & 1 deletion test/integrationTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('Integration tests', () => {
let err;
try {
await connection.connect();
} catch (error) {
} catch (error: any) {
err = error;
}
expect(err.message).to.contain('ACCESS-REFUSED');
Expand Down

0 comments on commit e2e6491

Please sign in to comment.