Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gnarea committed Dec 7, 2020
1 parent 732d248 commit 943ce0a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/_test_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { BinaryLike, createHash, Hash } from 'crypto';
import pino, { symbols as PinoSymbols } from 'pino';
import split2 from 'split2';

import { BasicLogger } from './services/types';

export const UUID4_REGEX = expect.stringMatching(/^[0-9a-f-]+$/);

export const MONGO_ENV_VARS = {
Expand Down Expand Up @@ -80,7 +82,7 @@ export function makeMockLogging(): MockLogging {
return { logger, logs };
}

export function partialPinoLogger(bindings: { readonly [key: string]: any }): object {
export function partialPinoLogger(bindings: { readonly [key: string]: any }): BasicLogger {
return expect.objectContaining({
[PinoSymbols.formattersSym]: { bindings },
});
Expand Down
2 changes: 1 addition & 1 deletion src/services/cogrpc/service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ describe('collectCargo', () => {

expect(MOCK_RETRIEVE_ACTIVE_PARCELS).toBeCalledWith(
PEER_GATEWAY_ADDRESS,
partialPinoLogger({ peerGatewayAddress: PEER_GATEWAY_ADDRESS }),
partialPinoLogger({ peerGatewayAddress: PEER_GATEWAY_ADDRESS }) as any,
);
});

Expand Down
3 changes: 2 additions & 1 deletion src/services/crcQueueWorker.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
SessionlessEnvelopedData,
SessionPublicKeyData,
} from '@relaycorp/relaynet-core';
import { Connection } from 'mongoose';
import * as stan from 'node-nats-streaming';

import { mockPino, mockSpy, PdaChain } from '../_test_utils';
Expand Down Expand Up @@ -58,7 +59,7 @@ mockSpy(jest.spyOn(NatsStreamingClient, 'initFromEnv'), () => mockNatsClient);

//region Mongoose-related fixtures

const MOCK_MONGOOSE_CONNECTION = { what: 'mongooseConnection' };
const MOCK_MONGOOSE_CONNECTION: Connection = { what: 'mongooseConnection' } as any;
mockSpy(jest.spyOn(mongo, 'createMongooseConnectionFromEnv'), () => MOCK_MONGOOSE_CONNECTION);

//region Keystore-related fixtures
Expand Down

0 comments on commit 943ce0a

Please sign in to comment.