ok
Some checks failed
CI / validate (push) Has been cancelled

This commit is contained in:
isopropilick
2026-08-27 15:00:50 -06:00
parent b35387d841
commit 896c3a121a
19 changed files with 569 additions and 0 deletions

14
test/support/test-data.ts Normal file
View File

@@ -0,0 +1,14 @@
import { loadQkforceTestData } from './qkforce-test-data.mjs';
export type QkforceScalarType = 'string' | 'integer' | 'number' | 'boolean' | 'date';
export interface QkforceTypeDescriptor { type: QkforceScalarType; nullable?: boolean; }
export type QkforceTypeRule = QkforceScalarType | QkforceTypeDescriptor;
export type QkforceTypedSchema = Readonly<Record<string, QkforceTypeRule>>;
export type QkforceRawRow = Readonly<Record<string, string>>;
export type QkforceTypedRow = Readonly<Record<string, string | number | boolean | null>>;
export interface QkforceDatasetMetadata { readonly datasetId:string; readonly versionId:string; readonly versionNumber:number; readonly logicalName:string; readonly path:string; readonly sha256:string; readonly rowCount:number; readonly contentType:'text/csv; charset=utf-8'; }
export interface QkforceDataset { readonly metadata:QkforceDatasetMetadata; readonly headers:readonly string[]; readonly rowCount:number; rows():readonly QkforceRawRow[]; row(index:number):QkforceRawRow; where(criteria:Readonly<Record<string,string>>):readonly QkforceRawRow[]; first(criteria:Readonly<Record<string,string>>):QkforceRawRow; typedRow(index:number,schema:QkforceTypedSchema):QkforceTypedRow; }
export interface QkforceTestDataProvenance { readonly testDataLockSha256?:string; readonly testData?:readonly Readonly<{datasetId:string;versionId:string;sha256:string}>[]; }
export interface QkforceTestDataProvider { readonly size:number; datasets():readonly QkforceDatasetMetadata[]; has(nameOrId:string):boolean; dataset(nameOrId:string):QkforceDataset; provenance():QkforceTestDataProvenance; }
export interface LoadQkforceTestDataOptions { required?: boolean; }
export function loadTestData(rootDirectory:string = process.cwd(), options:LoadQkforceTestDataOptions = {}):QkforceTestDataProvider { return loadQkforceTestData(rootDirectory, options) as QkforceTestDataProvider; }