Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(typos): Fix ampq typos #285

Merged
merged 1 commit into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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