Skip to content

Commit

Permalink
Merge pull request #285 from diegog/ampq-typo-fix
Browse files Browse the repository at this point in the history
refactor(typos): Fix ampq typos
  • Loading branch information
jwalton committed Oct 24, 2022
2 parents b61d3ae + 0688477 commit c78c4b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/AmqpConnectionManager.ts
Expand Up @@ -13,7 +13,7 @@ const HEARTBEAT_IN_SECONDS = 5;
export type ConnectionUrl =
| string
| amqp.Options.Connect
| { url: string; connectionOptions?: AmpqConnectionOptions };
| { url: string; connectionOptions?: AmqpConnectionOptions };

export interface ConnectListener {
(arg: { connection: amqp.Connection; url: string | amqp.Options.Connect }): void;
Expand All @@ -23,7 +23,7 @@ export interface ConnectFailedListener {
(arg: { err: Error; url: string | amqp.Options.Connect | undefined }): void;
}

export type AmpqConnectionOptions = (ConnectionOptions | TcpSocketConnectOpts) & {
export type AmqpConnectionOptions = (ConnectionOptions | TcpSocketConnectOpts) & {
noDelay?: boolean;
timeout?: number;
keepAlive?: boolean;
Expand Down Expand Up @@ -66,7 +66,7 @@ export interface AmqpConnectionManagerOptions {
| undefined;

/** Connection options, passed as options to the amqplib.connect() method. */
connectionOptions?: AmpqConnectionOptions;
connectionOptions?: AmqpConnectionOptions;
}

/* istanbul ignore next */
Expand All @@ -80,7 +80,7 @@ function neverThrows() {
}

export interface IAmqpConnectionManager {
connectionOptions?: AmpqConnectionOptions;
connectionOptions?: AmqpConnectionOptions;
heartbeatIntervalInSeconds: number;
reconnectTimeInSeconds: number;

Expand Down Expand Up @@ -157,7 +157,7 @@ export default class AmqpConnectionManager extends EventEmitter implements IAmqp
| (() => Promise<ConnectionUrl | ConnectionUrl[]>);
private _urls?: ConnectionUrl[];

public connectionOptions: AmpqConnectionOptions | undefined;
public connectionOptions: AmqpConnectionOptions | undefined;
public heartbeatIntervalInSeconds: number;
public reconnectTimeInSeconds: number;

Expand Down
6 changes: 3 additions & 3 deletions test/AmqpConnectionManagerTest.ts
@@ -1,4 +1,4 @@
import origAmpq from 'amqplib';
import origAmqp from 'amqplib';
import chai from 'chai';
import chaiString from 'chai-string';
import { once } from 'events';
Expand All @@ -15,7 +15,7 @@ describe('AmqpConnectionManager', function () {
let amqp: AmqpConnectionManager | undefined;

beforeEach(() => {
jest.spyOn(origAmpq, 'connect').mockImplementation(((url: string) =>
jest.spyOn(origAmqp, 'connect').mockImplementation(((url: string) =>
amqplib.connect(url)) as any);
amqplib.reset();
});
Expand Down Expand Up @@ -169,7 +169,7 @@ describe('AmqpConnectionManager', function () {
});

it('should timeout connect', async () => {
jest.spyOn(origAmpq, 'connect').mockImplementation((): any => {
jest.spyOn(origAmqp, 'connect').mockImplementation((): any => {
return promiseTools.delay(200);
});
amqp = new AmqpConnectionManager('amqp://localhost');
Expand Down

0 comments on commit c78c4b2

Please sign in to comment.