@accounter/server
Version:
Accounter GraphQL server
22 lines (21 loc) • 808 B
TypeScript
import type { Injector } from 'graphql-modules';
import type { Pool } from 'pg';
import type { Currency } from '../shared/enums.js';
export type ModuleContextLike = {
injector: Injector;
moduleId: string;
env?: unknown;
};
export type ExchangeRateMockFn = (baseCurrency: Currency, quoteCurrency: Currency, date: Date) => Promise<number>;
export declare function createLedgerTestContext(options: {
pool: Pool;
moduleId?: string;
env?: unknown;
businessId: string;
/**
* Optional mock function to override ExchangeProvider.getExchangeRates.
* Use this to fix exchange rates for deterministic tests.
* @see createMockExchangeRates, mockExchangeRate from __tests__/helpers/exchange-mock.ts
*/
mockExchangeRates?: ExchangeRateMockFn;
}): ModuleContextLike;