T-79: tests
This commit is contained in:
parent
be06a00ffe
commit
63b4c420c3
2 changed files with 571 additions and 0 deletions
|
|
@ -230,3 +230,95 @@ void _query;
|
|||
void _ctx;
|
||||
void _range;
|
||||
void _budget;
|
||||
|
||||
// QA: exact parameter/return signatures for every §4 method. Assignability of
|
||||
// the stub above cannot catch optionality drift (e.g. `crossSection.asOf`
|
||||
// becoming required), so assert type identity against the documented shapes.
|
||||
type ParamOf<K extends keyof MarketDataStore> = Parameters<MarketDataStore[K]>[0];
|
||||
type ReturnOf<K extends keyof MarketDataStore> = ReturnType<MarketDataStore[K]>;
|
||||
|
||||
const _exactMethodKeys: AssertEqual<
|
||||
keyof MarketDataStore,
|
||||
| 'bars'
|
||||
| 'crossSection'
|
||||
| 'fundamentalsAsOf'
|
||||
| 'events'
|
||||
| 'shortsAsOf'
|
||||
| 'macroAsOf'
|
||||
| 'fx'
|
||||
| 'universe'
|
||||
> = true;
|
||||
const _exactScope: AssertEqual<DataScope, 'vault_fenced' | 'vault_evaluation_only'> = true;
|
||||
const _exactBarsParam: AssertEqual<
|
||||
ParamOf<'bars'>,
|
||||
{
|
||||
listingIds: number[];
|
||||
timeframe: '1m' | '5m' | '1h' | '1d';
|
||||
from: string;
|
||||
to: string;
|
||||
adjustment: 'raw' | 'split' | 'total';
|
||||
asOf?: string;
|
||||
scope?: DataScope;
|
||||
}
|
||||
> = true;
|
||||
const _exactBarsReturn: AssertEqual<ReturnOf<'bars'>, AsyncIterable<BarBatch>> = true;
|
||||
const _exactCrossParam: AssertEqual<
|
||||
ParamOf<'crossSection'>,
|
||||
{ features: string[]; date: string; universe: UniverseRef; asOf?: string }
|
||||
> = true;
|
||||
const _exactCrossReturn: AssertEqual<ReturnOf<'crossSection'>, Promise<Table>> = true;
|
||||
const _exactFundParam: AssertEqual<
|
||||
ParamOf<'fundamentalsAsOf'>,
|
||||
{ listingIds: number[]; fields: string[]; asOf: string; allowEstimatedLag?: boolean }
|
||||
> = true;
|
||||
const _exactFundReturn: AssertEqual<ReturnOf<'fundamentalsAsOf'>, Promise<Table>> = true;
|
||||
const _exactEventsParam: AssertEqual<
|
||||
ParamOf<'events'>,
|
||||
{ kinds: EventKind[]; listingIds?: number[]; from: string; to: string; asOf?: string }
|
||||
> = true;
|
||||
const _exactEventsReturn: AssertEqual<ReturnOf<'events'>, Promise<Table>> = true;
|
||||
const _exactShortsParam: AssertEqual<
|
||||
ParamOf<'shortsAsOf'>,
|
||||
{ listingIds: number[]; from: string; to: string; asOf?: string }
|
||||
> = true;
|
||||
const _exactShortsReturn: AssertEqual<ReturnOf<'shortsAsOf'>, Promise<Table>> = true;
|
||||
const _exactMacroParam: AssertEqual<
|
||||
ParamOf<'macroAsOf'>,
|
||||
{ countries: string[]; indicators: string[]; from: string; to: string; asOf?: string }
|
||||
> = true;
|
||||
const _exactMacroReturn: AssertEqual<ReturnOf<'macroAsOf'>, Promise<Table>> = true;
|
||||
const _exactFxParam: AssertEqual<
|
||||
ParamOf<'fx'>,
|
||||
{ pair: 'USD.CAD'; timeframe: '1m' | '1d'; from: string; to: string }
|
||||
> = true;
|
||||
const _exactFxReturn: AssertEqual<ReturnOf<'fx'>, Promise<Table>> = true;
|
||||
const _exactUniverseParam: AssertEqual<
|
||||
ParamOf<'universe'>,
|
||||
{ ref: UniverseRef; date: string }
|
||||
> = true;
|
||||
const _exactUniverseReturn: AssertEqual<ReturnOf<'universe'>, Promise<number[]>> = true;
|
||||
|
||||
// Sanity: the helper must actually detect optionality drift.
|
||||
const _detectsOptionalityDrift: AssertEqual<{ asOf?: string }, { asOf: string }> = false;
|
||||
|
||||
void [
|
||||
_exactMethodKeys,
|
||||
_exactScope,
|
||||
_exactBarsParam,
|
||||
_exactBarsReturn,
|
||||
_exactCrossParam,
|
||||
_exactCrossReturn,
|
||||
_exactFundParam,
|
||||
_exactFundReturn,
|
||||
_exactEventsParam,
|
||||
_exactEventsReturn,
|
||||
_exactShortsParam,
|
||||
_exactShortsReturn,
|
||||
_exactMacroParam,
|
||||
_exactMacroReturn,
|
||||
_exactFxParam,
|
||||
_exactFxReturn,
|
||||
_exactUniverseParam,
|
||||
_exactUniverseReturn,
|
||||
_detectsOptionalityDrift,
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue