Reference · Parsing, formatting and shared types
AddressValidationTestCasetype
A validation case in the package's JSON test files: an address and the verdict and codes expected.
Import it
import type { AddressValidationTestCase } from "@johnmorrisdotca/address-plus";
Definition
interface AddressValidationTestCase extends TestCaseBase {
input: string;
expected: {
isValid: boolean;
confidence?: number;
completeness?: number;
errors?: string[];
warnings?: string[];
[key: string]: unknown;
};
}
Members
| Name | Type | Description |
|---|---|---|
input | string | |
expected | { [key: string]: unknown; isValid: boolean; confidence?: number; completeness?: number; errors?: string[]; warnings?: string[]; } | |
name (optional) | string | undefined | |
description (optional) | string | undefined | |
options (optional) | Record<string, unknown> | undefined |
Examples
import type { AddressValidationTestCase } from "@johnmorrisdotca/address-plus";
console.log(({ input: "123 Main St", expected: { isValid: false } }).expected.isValid);
// → falsefalseWhat it prints (run when this page was built)