Skip to content

Commit

Permalink
chore(tests): remove redundant connection restore
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkvak committed Oct 8, 2021
1 parent 407ed46 commit 5bae7b3
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ describe('#postMessage', () => {
jest.spyOn(Date, 'now').mockImplementation(() => now);
});

afterEach(() => {
serviceConnection.connection = Promise.resolve(amqpConnection);
});

it('throws error if connection is null', async () => {
serviceConnection.connection = null;
await expect(serviceConnection.postMessage(['news'], { foo: 'bar' }, { messageId: '42' })).rejects.toThrow(ConnectionNotInitialized);
Expand Down Expand Up @@ -455,10 +451,6 @@ describe('#messageHandler', () => {
}
};

afterEach(() => {
serviceConnection.connection = Promise.resolve(amqpConnection);
});

it('throws error if connection is null', async () => {
serviceConnection.connection = null;

Expand Down Expand Up @@ -593,10 +585,6 @@ describe('#subscribe', () => {
});

describe('#subscribeOn', () => {
afterEach(() => {
serviceConnection.connection = Promise.resolve(amqpConnection);
});

it('throws error if connection is null', async () => {
serviceConnection.connection = null;
await expect(serviceConnection.subscribeOn('actionAction', jest.fn())).rejects.toThrow(ConnectionNotInitialized);
Expand Down Expand Up @@ -637,10 +625,6 @@ describe('#initQueue', () => {
});

describe('#unsubscribe', () => {
afterEach(() => {
serviceConnection.connection = Promise.resolve(amqpConnection);
});

it('throws error if connection is null', async () => {
serviceConnection.connection = null;

Expand All @@ -658,10 +642,6 @@ describe('#unsubscribe', () => {
});

describe('#consumeQueue', () => {
afterEach(() => {
serviceConnection.connection = Promise.resolve(amqpConnection);
});

it('throws error if connection is null', async () => {
serviceConnection.connection = null;
await expect(serviceConnection.consumeQueue('dispatcher', jest.fn())).rejects.toThrow(ConnectionNotInitialized);
Expand Down

0 comments on commit 5bae7b3

Please sign in to comment.