Reference · Parsing, formatting and shared types
BatchProcessingTestCasetype
A batch case in the package's JSON test files: several addresses and the counts expected.
Import it
import type { BatchProcessingTestCase } from "@johnmorrisdotca/address-plus";
Definition
interface BatchProcessingTestCase extends TestCaseBase {
input: string[];
expected: {
results?: unknown[];
statistics?: {
total: number;
successful: number;
failed: number;
};
errors?: Array<{
index: number;
error: string;
}>;
[key: string]: unknown;
};
}
Members
| Name | Type | Description |
|---|---|---|
input | string[] | |
expected | { [key: string]: unknown; results?: unknown[]; statistics?: { total: number; successful: number; failed: number; }; errors?: Array<{ index: number; error: string; }>; } | |
name (optional) | string | undefined | |
description (optional) | string | undefined | |
options (optional) | Record<string, unknown> | undefined |
Examples
import type { BatchProcessingTestCase } from "@johnmorrisdotca/address-plus";
console.log(({ input: ["123 Main St"], expected: { successful: 1 } }).expected.successful);
// → 11What it prints (run when this page was built)