Skip to content

Commit

Permalink
feat: export MockPoolOverridesType (fixes #231)
Browse files Browse the repository at this point in the history
  • Loading branch information
gajus committed Aug 6, 2021
1 parent cdca0d0 commit 024848a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/factories/createMockPool.ts
Expand Up @@ -13,17 +13,14 @@ import {
import type {
ClientConfigurationInputType,
DatabasePoolType,
MockPoolOverridesType,
PrimitiveValueExpressionType,
QueryResultRowType,
QueryResultType,
} from '../types';

type OverridesType = {
readonly query: (sql: string, values: readonly PrimitiveValueExpressionType[]) => Promise<QueryResultType<QueryResultRowType>>,
};

export const createMockPool = (
overrides: OverridesType,
overrides: MockPoolOverridesType,
clientConfigurationInput?: ClientConfigurationInputType,
): DatabasePoolType => {
const clientConfiguration = createClientConfiguration(clientConfigurationInput);
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -21,6 +21,7 @@ export type {
InterceptorType,
JsonSqlTokenType,
ListSqlTokenType,
MockPoolOverridesType,
PgClientType,
QueryContextType,
QueryResultRowColumnType,
Expand Down
4 changes: 4 additions & 0 deletions src/types.ts
Expand Up @@ -446,3 +446,7 @@ export type InterceptorType = {
};

export type IdentifierNormalizerType = (identifierName: string) => string;

export type MockPoolOverridesType = {
readonly query: (sql: string, values: readonly PrimitiveValueExpressionType[]) => Promise<QueryResultType<QueryResultRowType>>,
};

0 comments on commit 024848a

Please sign in to comment.