Skip to content

Commit

Permalink
Merge pull request #76 from nitrictech/refactor/remove-duplicate
Browse files Browse the repository at this point in the history
chore: remove duplicate mock
  • Loading branch information
jyecusch authored Oct 29, 2021
2 parents 3285d9b + 10bce75 commit c984557
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions examples/queues/queues-examples.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@
import { queueReceive } from './receive';
import { queueSend } from './send';
import { QueueServiceClient } from '@nitric/api/proto/queue/v1/queue_grpc_pb';
import { QueueReceiveResponse, QueueSendBatchResponse } from '@nitric/api/proto/queue/v1/queue_pb';
import {
QueueReceiveResponse,
QueueSendBatchResponse,
} from '@nitric/api/proto/queue/v1/queue_pb';
import { queueFailed } from './failed';

const proto = QueueServiceClient.prototype;

const CALLBACKFN = (response) => (_, cb: any) => cb(null, response);


describe('test queues snippets', () => {
beforeAll(() => {
jest
Expand All @@ -30,9 +32,6 @@ describe('test queues snippets', () => {
jest
.spyOn(proto, 'receive')
.mockImplementation(CALLBACKFN(new QueueReceiveResponse()));
jest
.spyOn(proto, 'sendBatch')
.mockImplementation(CALLBACKFN(new QueueSendBatchResponse()));
});

test('ensure all queues snippets run', async () => {
Expand Down

0 comments on commit c984557

Please sign in to comment.